Re: Questions about clock_gettime and friends

2012-03-06 Thread Remco
Woodchuck wrote: > I. The system call clock_getres(2) and clock_gettime(2) show strange > results. > > Consider this small program and its output on OpenBSD 5.0, amd64: > > #include > #include > > main() > { > struct timespec tp; > int i; > > clock_getres(CLOCK_REALTIME,

Re: Questions about clock_gettime and friends

2012-03-05 Thread Woodchuck
On Tue, Mar 06, 2012 at 07:47:06AM +0100, Otto Moerbeek wrote: > On Tue, Mar 06, 2012 at 01:01:57AM -0500, Woodchuck wrote: > > BTW, your format strings are not right, both in size of operand and > signedness. Here: Oops. > > > printf("Resolution: %lu %lu\n", tp.tv_sec, tp.tv_nsec); >

Re: Questions about clock_gettime and friends

2012-03-05 Thread Otto Moerbeek
On Tue, Mar 06, 2012 at 01:01:57AM -0500, Woodchuck wrote: > I. The system call clock_getres(2) and clock_gettime(2) show strange > results. > > Consider this small program and its output on OpenBSD 5.0, amd64: > > #include > #include > > main() > { > struct timespec tp; > int

Re: Questions about clock_gettime and friends

2012-03-05 Thread Otto Moerbeek
On Tue, Mar 06, 2012 at 01:01:57AM -0500, Woodchuck wrote: > I. The system call clock_getres(2) and clock_gettime(2) show strange > results. > > Consider this small program and its output on OpenBSD 5.0, amd64: > > #include > #include > > main() > { > struct timespec tp; > int

Questions about clock_gettime and friends

2012-03-05 Thread Woodchuck
I. The system call clock_getres(2) and clock_gettime(2) show strange results. Consider this small program and its output on OpenBSD 5.0, amd64: #include #include main() { struct timespec tp; int i; clock_getres(CLOCK_REALTIME, &tp); printf("Resolut