File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 3636 # Ensure that hours, min and seconds are separated by ':' not '.'
3737 timePor = timePor .replace ('.' ,':' )
3838 # Calculate elapsed time that has this format 'h:m:s'
39- timeList = timePor .split (':' , 2 )
40- elapsedTime = int (timeList [0 ])* 3600 + int (timeList [1 ])* 60 + int (timeList [2 ])
39+ timeList = timePor .split (':' )
40+ if len (timeList ) == 2 :
41+ # Only minutes and seconds are present
42+ elapsedTime = int (timeList [0 ])* 60 + int (timeList [1 ])
43+ elif len (timeList ) == 3 :
44+ # Hours, minutes, and seconds are present
45+ elapsedTime = int (timeList [0 ])* 3600 + int (timeList [1 ])* 60 + int (timeList [2 ])
4146
4247 # Print the name of the step and the corresponding elapsed time
4348 print ('%-25s %10s' % (os .path .splitext (os .path .basename (str (f )))[0 ], elapsedTime ))
You can’t perform that action at this time.
0 commit comments