plop this into a python script and run it. this is going to ask for the current cursor position as many times as it can within 8 milliseconds. LOL and then it is going to tell you how many times it got the position when it is done. i have it calculating the time in nanoseconds 0.000000001 seconds. Or a billionth of a second.
run it 3 or 4 times.
Code: Select all
import time
import ctypes
from ctypes.wintypes import BOOL, POINT
user32 = ctypes.windll.user32
tmp = []
GetCursorPos = user32.GetCursorPos
GetCursorPos.restype = BOOL
pos = POINT()
point = ctypes.byref(pos)
start_time = time.time()
while (time.time() - start_time) * 1000000000 < 8000000.0:
GetCursorPos(point)
tmp += [[pos.x, pos.y]]
print 'number of gotten positions:', len(tmp)
print 'number of gotten positions per millisecond:', len(tmp) / 8
print 'one position gotten every:', 8.0 / len(tmp), 'milliseconds'
print ' ', 8000.0 / len(tmp), 'microseconds'
print ' ', 8000000.0 / len(tmp), 'nanoseconds'
1.016703362164 nanoseconds – time taken by light to travel 1 foot in a vacuum
3.3356409519815 nanoseconds – time taken by light to travel 1 metre in a vacuum
20–40 nanoseconds – time of fusion reaction in a hydrogen bomb