Running time calculator using python

This program will calculate the running time of any program. Just change your linux command accrdingly. Thats it. It is a simple function in python.

import time
import sys
import os
val1 = time.time()
print val1
filename1 = sys.argv[1]
os.system(‘gcc ‘+filename1)
val2 = time.time()
print val2
print val2-val1

Try it out.

By intrepidkarthi

I am Karthikeyan, working as a software professional, interested in Travelling, Bike riding, PC Gaming, Reading Novels, Blogging, Writing thamizh poems.

Leave a Reply

Your email address will not be published.