viff

changeset 653:0743b624fb60

Flush standard output before starting test.
author Martin Geisler <mg@daimi.au.dk>
date Fri, 11 Apr 2008 16:21:52 +0200
parents 9c6a43bbbf8c
children f9fe663c0de1
files apps/benchmark.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/apps/benchmark.py	Mon Apr 07 22:46:15 2008 +0200
     1.2 +++ b/apps/benchmark.py	Fri Apr 11 16:21:52 2008 +0200
     1.3 @@ -53,6 +53,7 @@
     1.4  # In all cases the time reported is measured from the moment when the
     1.5  # operands are ready until all the results are ready.
     1.6  
     1.7 +import sys
     1.8  import time
     1.9  from optparse import OptionParser
    1.10  import operator
    1.11 @@ -131,15 +132,18 @@
    1.12  
    1.13      def sync_test(self, _):
    1.14          print "Synchronizing test start."
    1.15 +        sys.stdout.flush()
    1.16          sync = self.rt.synchronize()
    1.17          sync.addCallback(self.countdown, 3)
    1.18  
    1.19      def countdown(self, _, seconds):
    1.20          if seconds > 0:
    1.21              print "Starting test in %d" % seconds
    1.22 +            sys.stdout.flush()
    1.23              reactor.callLater(1, self.countdown, None, seconds - 1)
    1.24          else:
    1.25              print "Starting test now"
    1.26 +            sys.stdout.flush()
    1.27              self.run_test(None)
    1.28  
    1.29      def run_test(self, _):