Re: nanosleep() accuracy

2007-08-17 Thread Michal Schmidt
GolovaSteek wrote: > 2007/8/17, Michal Schmidt <[EMAIL PROTECTED]>: > >> GolovaSteek skrev: >> >>> Hello! >>> I need use sleep with accurat timing. >>> I use 2.6.21 with rt-prempt patch. >>> with enabled rt_preempt, dyn_ticks, and local_apic >>> But >>> >>> req.tv_nsec = 30; >>>

Re: nanosleep() accuracy

2007-08-17 Thread Jan Engelhardt
On Aug 17 2007 11:44, GolovaSteek wrote: >> How do you measure this? >> If you want to have something done every 300 microseconds, you must not >> sleep for 300 microseconds in each iteration, because you'd accumulate >> errors. Use a periodic timer or use the current time to compute how long >>

Re: nanosleep() accuracy

2007-08-17 Thread GolovaSteek
2007/8/17, Michal Schmidt <[EMAIL PROTECTED]>: > GolovaSteek skrev: > > Hello! > > I need use sleep with accurat timing. > > I use 2.6.21 with rt-prempt patch. > > with enabled rt_preempt, dyn_ticks, and local_apic > > But > > > > req.tv_nsec = 30; > > req.tv_sec = 0; > > nanosleep(,NULL) > >

Re: nanosleep() accuracy

2007-08-17 Thread Michal Schmidt
GolovaSteek skrev: Hello! I need use sleep with accurat timing. I use 2.6.21 with rt-prempt patch. with enabled rt_preempt, dyn_ticks, and local_apic But req.tv_nsec = 30; req.tv_sec = 0; nanosleep(,NULL) make pause around 310-330 microseconds. How do you measure this? If you want to

Re: nanosleep() accuracy

2007-08-17 Thread Michal Schmidt
GolovaSteek skrev: Hello! I need use sleep with accurat timing. I use 2.6.21 with rt-prempt patch. with enabled rt_preempt, dyn_ticks, and local_apic But req.tv_nsec = 30; req.tv_sec = 0; nanosleep(req,NULL) make pause around 310-330 microseconds. How do you measure this? If you want to

Re: nanosleep() accuracy

2007-08-17 Thread GolovaSteek
2007/8/17, Michal Schmidt [EMAIL PROTECTED]: GolovaSteek skrev: Hello! I need use sleep with accurat timing. I use 2.6.21 with rt-prempt patch. with enabled rt_preempt, dyn_ticks, and local_apic But req.tv_nsec = 30; req.tv_sec = 0; nanosleep(req,NULL) make pause around

Re: nanosleep() accuracy

2007-08-17 Thread Jan Engelhardt
On Aug 17 2007 11:44, GolovaSteek wrote: How do you measure this? If you want to have something done every 300 microseconds, you must not sleep for 300 microseconds in each iteration, because you'd accumulate errors. Use a periodic timer or use the current time to compute how long to sleep

Re: nanosleep() accuracy

2007-08-17 Thread Michal Schmidt
GolovaSteek wrote: 2007/8/17, Michal Schmidt [EMAIL PROTECTED]: GolovaSteek skrev: Hello! I need use sleep with accurat timing. I use 2.6.21 with rt-prempt patch. with enabled rt_preempt, dyn_ticks, and local_apic But req.tv_nsec = 30; req.tv_sec = 0; nanosleep(req,NULL)