##// END OF EJS Templates
Add printing of wall time to %run, particularly important for parallel timing.
Fernando Perez -
Show More
@@ -1684,6 +1684,7 b' Currently the magic system has the following functions:\\n"""'
1684 1684 return
1685 1685 except (KeyError):
1686 1686 nruns = 1
1687 twall0 = time.time()
1687 1688 if nruns == 1:
1688 1689 t0 = clock2()
1689 1690 runner(filename,prog_ns,prog_ns,
@@ -1692,8 +1693,8 b' Currently the magic system has the following functions:\\n"""'
1692 1693 t_usr = t1[0]-t0[0]
1693 1694 t_sys = t1[1]-t0[1]
1694 1695 print "\nIPython CPU timings (estimated):"
1695 print " User : %10s s." % t_usr
1696 print " System: %10s s." % t_sys
1696 print " User : %10.2f s." % t_usr
1697 print " System : %10.2f s." % t_sys
1697 1698 else:
1698 1699 runs = range(nruns)
1699 1700 t0 = clock2()
@@ -1705,10 +1706,12 b' Currently the magic system has the following functions:\\n"""'
1705 1706 t_sys = t1[1]-t0[1]
1706 1707 print "\nIPython CPU timings (estimated):"
1707 1708 print "Total runs performed:",nruns
1708 print " Times : %10s %10s" % ('Total','Per run')
1709 print " User : %10s s, %10s s." % (t_usr,t_usr/nruns)
1710 print " System: %10s s, %10s s." % (t_sys,t_sys/nruns)
1711
1709 print " Times : %10.2f %10.2f" % ('Total','Per run')
1710 print " User : %10.2f s, %10.2f s." % (t_usr,t_usr/nruns)
1711 print " System : %10.2f s, %10.2f s." % (t_sys,t_sys/nruns)
1712 twall1 = time.time()
1713 print "Wall time: %10.2f s." % (twall1-twall0)
1714
1712 1715 else:
1713 1716 # regular execution
1714 1717 runner(filename,prog_ns,prog_ns,exit_ignore=exit_ignore)
General Comments 0
You need to be logged in to leave comments. Login now