Greetings Jan, I am not really concerned with minimum resolution. I do not need intervals less than 25 ms but I need them to be consistent. I am also not concerned with a variation of 1 ms from one sleep cycle to the next. The application is used for testing and it is understood that it should be the only app running and it will be fine if it slows or stops other threads. I am using perlapp to create the distributable exe. Is there any way to force the highest process priority to the application to minimize the effects of other windows processes?
Wednesday, March 29, 2006, 1:30:25 PM, you wrote: > On Wed, 29 Mar 2006, Paul Sobey wrote: >> > What resolution are you getting ? >> > >> > I get like 3 or 4 mics for a minimum sleep. >> > >> > use Time::HiRes qw(usleep); >> > >> > for (1 .. 10) { my $amics = usleep (0.000000001); printf "%u >> > mics\n", $amics; } >> >> I had heard that any kind of timing on Windows won't go below 1ms >> resolution - the following would seem to back that up: >> >> http://www.sysinternals.com/Information/HighResolutionTimers.html > You can get better time resolution using performance counters, but > there is no sleep() API that uses less than 1ms granularity. > Time::HiRes uses the performance counter method to measure time > intervals, but the usleep() function is "implemented" on Windows > similar to this: > sub usleep { Win32::Sleep( $_[0]/1000 ) } > So you won't get less than millisecond resolution there either. You may > just yield the rest of your timeslice if you ask to sleep for less than 1ms > and there is another thread waiting to run that has at least the same > priority as yourself. > Of course the whole concept of using sleep() to achieve high precision > timings on a multi-tasking OS is kind of bogus anyways, at least at > the application layer. > Cheers, > -Jan -- Best regards, Spencer_Lists Chase mailto:[EMAIL PROTECTED] 67550 Bell Springs Rd. Garberville, CA 95542 Postal service only. Laytonville, CA 95454 UPS only. [EMAIL PROTECTED] http://www.spencerserolls.com http://www.spencerserolls.com/MidiValve.htm (707) 984-8356 _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs