From: Wolfgang Denk Date: Wed, 17 Oct 2012 12:05:43 +0200 Subject: [U-Boot] [PATCH] common/cmd_ext_common: measure throughput In-Reply-To: <1350467910-2014-1-git-send-email-andreas.devel@googlemail.com> References: <1350467910-2014-1-git-send-email-andreas.devel@googlemail.com> Message-ID: <20121017100543.292622029CB@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Andreas Bie?mann, In message <1350467910-2014-1-git-send-email-andreas.devel@googlemail.com> you wrote: > This patch adds time measurement and throughput calculation for the ext2load and > ext4load commands. ... > + unsigned long time_start; ... > + time_start = get_timer(0); > if (ext4fs_read((char *)addr, filelen) != filelen) { > printf("** Unable to read \"%s\" from %s %d:%d **\n", > filename, argv[1], dev, part); > ext4fs_close(); > goto fail; > } > + time_start = get_timer(time_start); There, "time_start" is clearly a mis-nomer. How about s/time_start/time/ ? > + print_size(filelen / time_start * 1000, "/s"); Does this give reasonable results for small files, say when loading a 20 byte file ? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "No matter where you go, there you are..." - Buckaroo Banzai