File tree Expand file tree Collapse file tree 1 file changed +21
-15
lines changed Expand file tree Collapse file tree 1 file changed +21
-15
lines changed Original file line number Diff line number Diff line change 1
1
import time
2
- import platform
2
+ try :
3
+ _clock = time .perf_counter # time.clock is deprecated in Python 3.3, gone in 3.8
4
+ except :
5
+ _clock = time .clock
6
+ _tick = 1 / 60
7
+
8
+ #import platform
3
9
import queue
4
10
import json
5
11
17
23
INTERACT_PERIOD = 1.0 / MAX_RENDERS
18
24
USER_FRACTION = 0.5
19
25
20
- _plat = platform .system ()
21
-
22
- if _plat == 'Windows' :
23
- # On Windows, the best timer is supposedly time.clock()
24
- _clock = time .clock
25
- _tick = 1 / 60
26
- elif _plat == 'Macintosh' :
27
- # On platforms other than Windows, the best timer is supposedly time.time()
28
- _clock = time .time
29
- _tick = 0.01
30
- else : # 'Unix'
31
- # On platforms other than Windows, the best timer is supposedly time.time()
32
- _clock = time .time
33
- _tick = 0.01 # though sleep seems to be accurate at the 1 millisecond level
26
+ ## _plat = platform.system()
27
+
28
+ ## if _plat == 'Windows':
29
+ ## # On Windows, the best timer is supposedly time.clock()
30
+ ## _clock = time.clock
31
+ ## _tick = 1/60
32
+ ## elif _plat == 'Macintosh':
33
+ ## # On platforms other than Windows, the best timer is supposedly time.time()
34
+ ## _clock = time.time
35
+ ## _tick = 0.01
36
+ ## else: # 'Unix'
37
+ ## # On platforms other than Windows, the best timer is supposedly time.time()
38
+ ## _clock = time.time
39
+ ## _tick = 0.01 # though sleep seems to be accurate at the 1 millisecond level
34
40
35
41
##Possible way to get one-millisecond accuracy in sleep on Windows:
36
42
##http://msdn.microsoft.com/en-us/library/windows/desktop/ms686298(v=vs.85).aspx
You can’t perform that action at this time.
0 commit comments