Last active
October 1, 2015 05:36
-
-
Save VladSem/3984980ae073e4c36f82 to your computer and use it in GitHub Desktop.
Pyhon: elapsed time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import time | |
modem_status = '' | |
start_time = time.time() | |
attempts_time = 0 | |
modem_status = 'Connected' | |
end_time = time.time() | |
total_time = end_time - start_time | |
hours = total_time // 3600 | |
total_time -= 3600 * hours | |
minutes = total_time // 60 | |
seconds = total_time - 60 * minutes | |
final_time = ('%d:%d:%d' % (hours, minutes, seconds)) | |
print 'Modem status: ' + modem_status + ' Test passed' | |
print 'Connec. time: ' + final_time | |
print 'Attempts: ' + str(attempts_time) + ' time(s)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment