progress: simplify performance measurement by using getnanotime()
commit83d26fa724ef2efbeb332fa3dc92b00c0e579f28
authorKarsten Blees <karsten.blees@gmail.com>
Sat, 12 Jul 2014 00:08:11 +0000 (12 02:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 14 Jul 2014 04:25:21 +0000 (13 21:25 -0700)
treee476793bdf739705a3c01533dc01b678fae1fcba
parent132d41e69a460f1bb72ba9eb41c513c42d9a8532
progress: simplify performance measurement by using getnanotime()

Calculating duration from a single uint64_t is simpler than from a struct
timeval. Change throughput measurement from gettimeofday() to
getnanotime().

Also calculate misec only if needed, and change integer division to integer
multiplication + shift, which should be slightly faster.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
progress.c