Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

More precise Thread.Sleep

Tags:

c#

How can i do Thread.Sleep(10.4166667);?

OK i see now that Sleep is not the way to go. So i use Timer but timer is also in ms put i need more precise Is there timer with nanosecond accuracy?

like image 821
Woland Avatar asked Oct 25 '25 21:10

Woland


1 Answers

So you want your thread to sleep precisely for that time and then resume? Forget about it. This parameter tells the system to wake the Thread after at least this number of milliseconds. At least. And after resuming, the thread could be put to sleep once again in a blink of an eye. That just how Operating Systems work and you cannot control it.

like image 135
Paweł Dyda Avatar answered Oct 27 '25 13:10

Paweł Dyda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!