From: Geert U. <ge...@li...> - 2002-12-08 10:34:36
|
On Sat, 7 Dec 2002, Ken Tyler wrote: > I've been trying to use usleep to get some millesecond delays in a prom > programmer but the delays are about twenty times too long i.e. > > for (i=0 ; i<500 ; i++) > usleep(1000L); > > should sleep for about 1/2 second but actually sleeps 10 secs > > Is this a kernel problem ? | callisto$ time ./a.out | | real 0m10.046s | user 0m0.000s | sys 0m0.010s | callisto$ | cassandra:/tmp# time ./a.out | | real 0m10.339s | user 0m0.030s | sys 0m0.080s | cassandra:/tmp# | vervain$ time ./a.out | | real 0m10.001s | user 0m0.000s | sys 0m0.010s | vervain$ Hmmm... callisto is my LongTrail, running Linux 2.4.20-rc1 cassandra is my A4000, running Linux 2.4.19 vervain is the Sun Blade 1000 at work, running Solaris 2.8 Apparently it's not Linux-specific... Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li... In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds |