From 16f1e35775c972ba8e02bc2d97d7a2eb333eae1b Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sun, 12 Oct 2008 19:56:52 +0100 Subject: [timer] Formalise the timer API We now have two implementations for the timer API: one using the time-of-day counter at 40:70 and one using RDTSC. Both make use of timer2_udelay(). --- src/core/monojob.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core/monojob.c') diff --git a/src/core/monojob.c b/src/core/monojob.c index 2c91e1322..a7e838514 100644 --- a/src/core/monojob.c +++ b/src/core/monojob.c @@ -63,7 +63,8 @@ struct job_interface monojob = { int monojob_wait ( const char *string ) { int key; int rc; - tick_t last_progress_dot; + unsigned long last_progress_dot; + unsigned long elapsed; printf ( "%s.", string ); monojob_rc = -EINPROGRESS; @@ -81,7 +82,8 @@ int monojob_wait ( const char *string ) { break; } } - if ( ( currticks() - last_progress_dot ) > TICKS_PER_SEC ) { + elapsed = ( currticks() - last_progress_dot ); + if ( elapsed > TICKS_PER_SEC ) { printf ( "." ); last_progress_dot = currticks(); } -- cgit v1.2.3-55-g7522