[luau] getting system time in milisecs

Lockhart, Charles Charles.Lockhart at SpirentCom.COM
Wed Sep 18 18:16:00 PDT 2002


I have some code that loops with some real-time constraints, and I need to
check the time per cycle.  The problem I run into is that adding "debug" to
log the time is somewhat inaccurate and impacts the loop.  The inaccuracy is
not such a big deal, within reason (I can still get kind of "worst case"
info), but I'd like to minimize the hup impact.  I'm trying to measure
performance for a standard kernel, a kernel with the preemptive kernel
patch, and a really real-time kernel.  Eventually I should probably just
write something that bangs on the parallel port and wire that to a scope,
but I'd like to use the "lazy way" first, to give me a general idea of
performance.

-Charles 

> -----Original Message-----
> From: Ray Strode [mailto:halfline at hawaii.rr.com]
> Sent: Wednesday, September 18, 2002 5:01 PM
> To: luau at videl.ics.hawaii.edu
> Subject: Re: [luau] getting system time in milisecs

... snip ...

> What do you need it for?  If you want to benchmark some algorithm or 
> something I think
> you can use clock() (run it once before, once after, subtract 
> and then 
> divide by
> CLOCKS_PER_SEC * 1000)
> 
> If you want to run some code after a specified amount of time 
> then you 
> can use alarm() or
> setitimer().
> 

... snip ...

> --Ray
> 
> _______________________________________________
> LUAU mailing list
> LUAU at videl.ics.hawaii.edu
> http://videl.ics.hawaii.edu/mailman/listinfo/luau
> 



More information about the LUAU mailing list