-
Notifications
You must be signed in to change notification settings - Fork 0
/
Stopwatch
36 lines (28 loc) · 815 Bytes
/
Stopwatch
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
# Connor Maloney, 11/15/13
# Stopwatch creation with Classes
import time
import thread
class Stopwatch:
def __init__(self, x=0):
self.x = x
def timeDisplay(self):
global timeDisplay
timeDisplay.insert("0:00:00.0")
self.d = self.x%10
self.e = self.x/10
self.a = int(e/60)
self.bc = int(e%60)
timeDisplay.insert(str(self.a)+"."+('%02d' % self.bc)+"."+str(self.d))
def start(self):
time.sleep(0.1)
thread.start_new_thread(start, (100,))
time.sleep(0.1)
def stop(self):
if start:
if self.x%10==0:
start=False
attempts += 1
def clear(self):
stopwatch.stop()
self.time = 0
format(time)