diff options
author | Guido van Rossum <guido@python.org> | 1992-12-14 23:25:04 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-12-14 23:25:04 (GMT) |
commit | e3cafbe7b85c350d4dbeb2af53fd8fc1ae66689b (patch) | |
tree | 3a6030b09829c527c8bb0fdcd6b36f6e9e332fe1 /Demo/rpc/T.py | |
parent | 5f59d6018e1b49c3bc581a0f69aa2bb1c88ae52b (diff) | |
download | cpython-e3cafbe7b85c350d4dbeb2af53fd8fc1ae66689b.zip cpython-e3cafbe7b85c350d4dbeb2af53fd8fc1ae66689b.tar.gz cpython-e3cafbe7b85c350d4dbeb2af53fd8fc1ae66689b.tar.bz2 |
Initial revision
Diffstat (limited to 'Demo/rpc/T.py')
-rw-r--r-- | Demo/rpc/T.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Demo/rpc/T.py b/Demo/rpc/T.py new file mode 100644 index 0000000..24d5e8a --- /dev/null +++ b/Demo/rpc/T.py @@ -0,0 +1,19 @@ +import sys, os, time + +def TSTART(): + global t0, t1 + u, s, cu, cs = os.times() + t0 = u+cu, s+cs, time.millitimer() + +def TSTOP(*label): + global t0, t1 + u, s, cu, cs = os.times() + t1 = u+cu, s+cs, time.millitimer() + tt = [] + for i in range(3): + tt.append(t1[i] - t0[i]) + [u, s, r] = tt + msg = '' + for x in label: msg = msg + (x + ' ') + msg = msg + `u` + ' user, ' + `s` + ' sys, ' + `r*0.001` + ' real\n' + sys.stderr.write(msg) |