blob: 24d5e8ae3e4f68b42a84c2b76a88190fce241797 [file] [log] [blame]
Guido van Rossume3cafbe1992-12-14 23:25:04 +00001import sys, os, time
2
3def TSTART():
4 global t0, t1
5 u, s, cu, cs = os.times()
6 t0 = u+cu, s+cs, time.millitimer()
7
8def TSTOP(*label):
9 global t0, t1
10 u, s, cu, cs = os.times()
11 t1 = u+cu, s+cs, time.millitimer()
12 tt = []
13 for i in range(3):
14 tt.append(t1[i] - t0[i])
15 [u, s, r] = tt
16 msg = ''
17 for x in label: msg = msg + (x + ' ')
18 msg = msg + `u` + ' user, ' + `s` + ' sys, ' + `r*0.001` + ' real\n'
19 sys.stderr.write(msg)