starttime = time.time() commands.getoutput(command) timetaken = time.time() - starttime