views:

173

answers:

4

I want to set a machine timer resolution to 0.5ms.

Sysinternal utility reports that the min clock resolution is 0.5ms so it can be done.

P.S. I know how to set it to 1ms.

P.P.S. I changed it from C# to more general question (thanks to Hans)

System timer resolution

A: 

Timer.Interval = 500;

Gnostus
that's 0.5 sec....
JSmaga
That is half a second. OP is asking for less than 1 ms.
bentsai
+1  A: 

You'll need a high resolution timer for it.. You can find some information here: http://www.codeproject.com/KB/cs/highperformancetimercshar.aspx

EDIT: More information can be found here: set to tenth of millisecond; http://msdn.microsoft.com/en-us/library/aa964692(VS.80).aspx

riffnl
Superceded by `System.Diagnostics.Stopwatch` in System.dll.
Charlie Salts
@Charlie Salts: That is class Bobb is looking for I guess (+1)
riffnl
I dont want to measure time I just need it tick faster.
Bobb
Why don't you build your own timercontrol with the classes above - added a new MSDN article. Most solutions for this kind of timing don't work with events, but with time-elapsed between two "states".
riffnl
riff i am sorry but the question is about different sort of timers..
Bobb
+2  A: 

The best you can get out the Win32 API is one millisecond with timeBeginPeriod and timeSetEvent. Maybe your HAL can do better but that's academic, you cannot write device driver code in C#.

Hans Passant
I alredy use those. I was hoping to get under that. Do you know if there is a utility which can do this (not necesserely in C#). I just need to change the system clock after all.
Bobb
I changed from C# to anything else. just need this to be done anyhow.
Bobb
A: 

NtSetTimerResolution

Bobb