[pypy-commit] lang-smalltalk default: (cfbolz, lwassermann): added conditional printing of results and additional time-measuring of perform
lwassermann
noreply at buildbot.pypy.org
Fri Mar 8 17:15:02 CET 2013
Author: Lars Wassermann <lars.wassermann at gmail.com>
Branch:
Changeset: r151:b4e0907d6045
Date: 2013-03-08 15:34 +0100
http://bitbucket.org/pypy/lang-smalltalk/changeset/b4e0907d6045/
Log: (cfbolz, lwassermann): added conditional printing of results and
additional time-measuring of perform
diff --git a/targetimageloadingsmalltalk.py b/targetimageloadingsmalltalk.py
--- a/targetimageloadingsmalltalk.py
+++ b/targetimageloadingsmalltalk.py
@@ -1,4 +1,4 @@
-import sys
+import sys, time
import os
from rpython.rlib.streamio import open_file_as_stream
@@ -10,14 +10,17 @@
def _run_benchmark(interp, number, benchmark):
w_object = model.W_SmallInteger(number)
+ t1 = time.time()
try:
w_result = interp.perform(w_object, benchmark)
except interpreter.ReturnFromTopLevel, e:
w_result = e.object
+ t2 = time.time()
if w_result:
- assert isinstance(w_result, model.W_BytesObject)
- print '\n'
- print w_result.as_string()
+ if isinstance(w_result, model.W_BytesObject):
+ print '\n'
+ print w_result.as_string()
+ print "took %s seconds" % (t2 - t1)
return 0
return -1
More information about the pypy-commit
mailing list