c# - Putting a thread to sleep for decimal value -


this question system.threading.thread.sleep(int). know there no method decimal value, need work decimals. here situation

i have device takes 20.37 milliseconds turn 1 degree. so, need put code sleep appropriate multiplication of 20.37 (2 degrees = 20.37*2 etc). since thread class got no decimal sleep method, how can this? please help!

that not work way. sleep grant thread sats idle x time, not won't stay idle more. end of sleep period means thread available scheduler run it, scheduler may chose run other threads/processes @ moment.

get initial instant, find final instant, , calculate current turn time passed. also, not forget check how precise time functions are.

real-time programming has particularities in own advice seek more info in topic before trying work. can pretty extensive (multiprocessing os vs monoprocessing, priorities, etc.)


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -