From 05e0feece96460cba17b286a17919d8bcef0428a Mon Sep 17 00:00:00 2001 From: Peter Stuge Date: Sun, 7 Sep 2008 03:14:27 +0000 Subject: flashrom: Debug print actual time base calculated by myusec_calibrate_delay() Signed-off-by: Peter Stuge Acked-by: Peter Stuge git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3569 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/flashrom/udelay.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/flashrom/udelay.c b/util/flashrom/udelay.c index f7257c9637..e4500ae4b0 100644 --- a/util/flashrom/udelay.c +++ b/util/flashrom/udelay.c @@ -55,6 +55,12 @@ void myusec_calibrate_delay() // compute one microsecond. That will be count / time micro = count / timeusec; - printf_debug("%ldM loops per second. ", (unsigned long)micro); + gettimeofday(&start, 0); + myusec_delay(100); + gettimeofday(&end, 0); + timeusec = 1000000 * (end.tv_sec - start.tv_sec) + + (end.tv_usec - start.tv_usec); + printf_debug("%ldM loops per second, 100 myus = %ld us. ", + (unsigned long)micro, timeusec); printf("OK.\n"); } -- cgit v1.2.3