Skip to content

Instantly share code, notes, and snippets.

@geekoff7
Created August 7, 2018 18:04
Show Gist options
  • Select an option

  • Save geekoff7/51f9e99adec91c94e768ea28faae270f to your computer and use it in GitHub Desktop.

Select an option

Save geekoff7/51f9e99adec91c94e768ea28faae270f to your computer and use it in GitHub Desktop.
time elapsed command line program !
#!/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