Feb-23-2019, 05:54 AM
Im getting an error when running this def and im not sure why. Its meant to be a stopwatch that runs and counts during what ever code you set it to start on.
def stopWatch(value): '''From seconds to Days;Hours:Minutes;Seconds''' valueD = (((value/365)/24)/60) Days = int (valueD) valueH = (valueD-Days)*365 Hours = int(valueH) valueM = (valueH - Hours)*24 Minutes = int(valueM) valueS = (valueM - Minutes)*60 Seconds = int(valueS) print("and you finished in", Days "days", Hours "Hours", Minutes "Minutes", Seconds "Seconds") start = time.time() # What in other posts is described is input("test ") end = time.time() stopWatch(end-start) #Use then my code