-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtimeTest.py
More file actions
37 lines (32 loc) · 1.29 KB
/
timeTest.py
File metadata and controls
37 lines (32 loc) · 1.29 KB
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
runTimeFile = open("runTime")
makeTimeFile = open("makeTime")
runTimeLines = runTimeFile.read().splitlines()
makeTimeLines = makeTimeFile.read().splitlines()
runTimeFile.close()
makeTimeFile.close()
totRunTime = 0
totMakeTime = 0
for line in runTimeLines:
if line[:3] == 'use':
min = line.find('m')
sec = 3 + line[4:].find('s')
currTime = 60*float(line[4:min].replace(',','.')) + float(line[min+1:sec+1].replace(',','.'))
totRunTime += currTime
elif line[:3] == 'sys':
min = line.find('m')
sec = 3 + line[4:].find('s')
currTime = 60*float(line[4:min].replace(',','.')) + float(line[min+1:sec+1].replace(',','.'))
totRunTime += currTime
for line in makeTimeLines:
if line[:3] == 'use':
min = line.find('m')
sec = 3 + line[4:].find('s')
currTime = 60*float(line[4:min].replace(',','.')) + float(line[min+1:sec+1].replace(',','.'))
totMakeTime += currTime
elif line[:3] == 'sys':
min = line.find('m')
sec = 3 + line[4:].find('s')
currTime = 60*float(line[4:min].replace(',','.')) + float(line[min+1:sec+1].replace(',','.'))
totMakeTime += currTime
print("\n\nTotal maketime was " + str(totMakeTime) + " seconds\n")
print("Total runtime was " + str(totRunTime) + " seconds\n")