]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Rot out all uses of time.milli*().
authorGuido van Rossum <guido@python.org>
Tue, 28 Dec 1993 21:36:18 +0000 (21:36 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 28 Dec 1993 21:36:18 +0000 (21:36 +0000)
Slightly improve debug output.

Demo/sgi/video/Vrec.py

index b3660e2e06826e7cb1526cefc81e006e7f64b492..9d90a8073ddff5957f8ac934380bc9ed34f8aaaf 100755 (executable)
@@ -293,7 +293,7 @@ def record(v, info, filename, audiofilename, mono, grey, greybits, \
                        initaudio(audiofilename, audiostop, audiodone)
        gl.wintitle('(rec) ' + filename)
        lastid = 0
-       t0 = time.millitimer()
+       t0 = time.time()
        count = 0
        ids = []
        v.InitContinuousCapture(info)
@@ -301,7 +301,7 @@ def record(v, info, filename, audiofilename, mono, grey, greybits, \
                try:
                        cd, id = v.GetCaptureData()
                except sv.error:
-                       #time.millisleep(10) # XXX is this necessary?
+                       #time.sleep(0.010) # XXX is this necessary?
                        sgi.nap(1)      # XXX Try by Jack
                        continue
                ids.append(id)
@@ -322,15 +322,16 @@ def record(v, info, filename, audiofilename, mono, grey, greybits, \
                        cd.UnlockCaptureData()
                        if filename:
                                queue.put((data, int(id*tpf)))
-       t1 = time.millitimer()
+       t1 = time.time()
        gl.wintitle('(busy) ' + filename)
-       print lastid, 'fields in', t1-t0, 'msec',
-       print '--', 0.1 * int(lastid * 10000.0 / (t1-t0)), 'fields/sec'
+       print lastid, 'fields in', round(t1-t0, 3), 'sec',
+       print '--', round(lastid/(t1-t0), 1), 'fields/sec'
        print 'Captured',count*2, 'fields,',
-       print 0.1*int(count*20000.0/(t1-t0)), 'f/s',
+       print round(count*2/(t1-t0), 1), 'f/s',
        if lastid:
-               print count*200.0/lastid, '%,',
-               print count*rate*200.0/lastid, '% of wanted rate',
+               print '(',
+               print round(count*200.0/lastid), '%, or',
+               print round(count*rate*200.0/lastid), '% of wanted rate )',
        print
        if ids:
                print 'Ids:',