SHARE
TWEET

main_timer.py3

rdrewd Mar 31st, 2013 (edited) 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from time import clock
  2. if __name__ == "__main__":
  3.     import sys
  4.     print("args=", sys.argv)
  5.     x="from " + sys.argv[1] + " import main"
  6.     print(x)
  7.     exec x
  8.     tstart=clock()*1000
  9.     answer=main()
  10.     tend=clock()*1000
  11.     print("answer=", answer)
  12.     print("tstart=", "%e" % tstart, "tend=", "%e" % tend)
  13.     print("runtime(CPU milliseconds)=", str(tend-tstart))
RAW Paste Data
Top