Created
August 7, 2018 18:04
-
-
Save geekoff7/51f9e99adec91c94e768ea28faae270f to your computer and use it in GitHub Desktop.
time elapsed command line program !
This file contains hidden or 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/env python3 | |
| # -*- coding: utf-8 -*- | |
| import time | |
| import sys | |
| from subprocess import call | |
| cmd = sys.argv | |
| t1 = time.perf_counter() | |
| call(cmd[1:]) | |
| t2 = time.perf_counter() | |
| res = round((t2 - t1), 4) | |
| print('=======================|', res, 'sec |=======================') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment