Hi Phil,
A while ago, someone on the IRC channel wrote some bindings to the Linux
libtimer library. However they have disappeared since then and the code was
not added to extra/.
We're missing the following features in the timers department:
- microsecond precision timers
- monotonic timers
- CPU time for the current process
- performance counters
It would be nice to have all of this work across platforms.
Slava
On Tue, Jun 24, 2008 at 3:59 AM, Phil Dawes <[EMAIL PROTECTED]> wrote:
> Hi Factor List,
>
> I've been doing some code profiling that requires a microsecond timer
> (measuring the accumulated time spent in words that take less than a
> millisecond for each invocation). To handle this on my 32bit linux box I
> used the following:
>
> FUNCTION: int gettimeofday ( void* TP, void* TZP ) ;
>
> : micros ( -- n )
> 8 <byte-array> dup f gettimeofday drop 2 c-ulong-array> first2
> [ 1000000 * ] dip + ;
>
> ...which obviously isn't portable. Looking at the source in os_unix.c
> and os_windows*.c it looks like the timers on all the platforms are of
> microsecond precision so I was wondering whether there was any objection
> to me putting a 'micros' primitive in the vm?
>
> (Actually I'm guessing that probably I don't know what I'm talking about
> and that there's a good reason why only 'millis' exists in factor)
>
> Cheers,
>
> Phil
>
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Factor-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk