-
Notifications
You must be signed in to change notification settings - Fork 0
/
showcase.py
52 lines (38 loc) · 834 Bytes
/
showcase.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import time
from timevery import Timer
a = Timer("Detect", show_freq=True, logger=print)
for i in range(5):
a.start()
time.sleep(0.1)
a.lap("detect")
if i % 2 == 0:
time.sleep(0.1)
a.lap("segment")
time.sleep(0.2)
a.lap("plot")
a.stop()
a.report()
with Timer("MakeRobot", show_report=True) as t:
time.sleep(1)
t.lap("foot")
time.sleep(1)
t.lap("hand")
time.sleep(1)
t.lap("head")
time.sleep(2)
t.lap("body")
time.sleep(1)
t.lap("combine")
@Timer("Locate")
def locate():
time.sleep(1)
print("located")
locate()
t = Timer(
"Sleep until next period", period=0.5, show_report=True, report_throttle_times=2
)
for i in range(5):
t.start()
time.sleep(0.1)
t.lap("do something")
t.sleep_until_next_period_and_stop()