Guest User

Untitled

a guest
May 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. import time
  2.  
  3. count=0
  4. while True:
  5. sample_rate=5000
  6.  
  7. time_start=time.perf_counter()
  8. count+=1
  9. while (time.perf_counter()-time_start) < (1/sample_rate):
  10. pass
  11.  
  12. if count == sample_rate:
  13. print(1/(time.perf_counter()-time_start))
  14. count=0
Add Comment
Please, Sign In to add comment