>
>
> > From: Tim Oborne <toborne@systems.DHL.COM>
> >
> > Thanks for the update. I'm trying to get clock ticks finer than one
> > second, is there any way other than wrappering my own version of the
> > POSIX times() ?
>
> I don't see how you can get finer granularity than your CPU supports.
> That's generally defined as _SC_CLK_TCK, found in <unistd.h> (CLK_TCK in
> <time.h>). Perl uses your OS's times() function, so it's already getting
> the best your machine can give.
>
> However now that you've made me look at it again Perl's times() function
> isn't returning everything it should return, though this doesn't affect the
> granularity you're looking for. It should return five values, not four. It
> needs to return the realtime as well as the four 'struct tms' fields. I've
> cc'd perl5-porters for this discussion.
times(2) on solaris is supposed to return ticks, but perl converts it to
seconds. I've used Tom's old itimers.pl, which lets you syscall() to the
[sg]etitimer() functions with great success. Perhaps it oughta be in the
CPAN, if times() is gonna stay the way it is.
Bill
>
> > From: Tim Oborne <toborne@systems.DHL.COM>
> >
> > Thanks for the update. I'm trying to get clock ticks finer than one
> > second, is there any way other than wrappering my own version of the
> > POSIX times() ?
>
> I don't see how you can get finer granularity than your CPU supports.
> That's generally defined as _SC_CLK_TCK, found in <unistd.h> (CLK_TCK in
> <time.h>). Perl uses your OS's times() function, so it's already getting
> the best your machine can give.
>
> However now that you've made me look at it again Perl's times() function
> isn't returning everything it should return, though this doesn't affect the
> granularity you're looking for. It should return five values, not four. It
> needs to return the realtime as well as the four 'struct tms' fields. I've
> cc'd perl5-porters for this discussion.
times(2) on solaris is supposed to return ticks, but perl converts it to
seconds. I've used Tom's old itimers.pl, which lets you syscall() to the
[sg]etitimer() functions with great success. Perhaps it oughta be in the
CPAN, if times() is gonna stay the way it is.
Bill