changeset 436:563d52c00f06

Print timings
author Chris Cannam
date Tue, 08 Oct 2013 15:37:47 +0100
parents bdda1da38eb1
children 88b44f514305
files src/may/test/test.yeti
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/may/test/test.yeti	Tue Oct 08 08:43:01 2013 +0100
+++ b/src/may/test/test.yeti	Tue Oct 08 15:37:47 2013 +0100
@@ -47,8 +47,8 @@
 time msg f =
    (start = System#currentTimeMillis();
     result = f ();
-    end = System#currentTimeMillis();
-    println "\(msg): \(end-start)ms";
+    finish = System#currentTimeMillis();
+    println "\(msg): \(finish-start)ms";
     result);
 
 select f = fold do r x: if f x then x::r else r fi done [];
@@ -68,10 +68,12 @@
         done testHash);
         
 runTests group testHash =
-   (failed = failedTests testHash;
+   (start = System#currentTimeMillis();
+    failed = failedTests testHash;
+    finish = System#currentTimeMillis();
     good = (length testHash - length failed);
     bad = length failed;
-    println "\(group): \(good)/\(good+bad) tests passed";
+    println "\(group): \(good)/\(good+bad) tests passed in \(finish-start)ms";
     if not empty? failed then
         println "\(group): Failed tests [\(bad)]: \(strJoin ' ' failed)";
     fi;