nanosecond
-
I want to make a one second while loop but the resolution of the time must be very high (nanosecond). Thanks
-
I'm not sure how you get the time in nanoseconds of the top of my head, but you might be able to do what you want to do with a timer function.
Bob X wrote:
you might be able to do what you want to do with a timer function
no chance (if you mean windows WM_TIMER) as it is not high enough resolution, QueryPerformanceCounter() is better but I don't think you will ever get a one nanosecond loop as WIndows is not a realtime operating system. See here: http://msdn.microsoft.com/msdnmag/issues/04/03/HighResolutionTimer/[^] Why do you need such accuracy anyway?
-
I want to make a one second while loop but the resolution of the time must be very high (nanosecond). Thanks
:confused:I am most intrigued by an application that requires an event to occur every second but to 1 billionth of a second accuracy, please tell us more... If you need +/- 1ns accuracy then because the windows OS family are not real time operating systems this will not be acheivable, perhaps +/- 10ns but realistically +/- 100ns should be assumed. If this is not adequate, then in order to measure to 1ns with an acceptable error then you actually need sub nanosecond timing solutions. Have you calculated what level of error you can tolerate in the application to which this problem pertains?