Skip to content

Commit

Permalink
add debug timer to runner
Browse files Browse the repository at this point in the history
  • Loading branch information
IR0NSIGHT committed Oct 30, 2023
1 parent 1182c60 commit cc66437
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion examples/fasteffekt/harness.effekt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ def doBenchmark(name: String, inner: Int, iterations: Int) = {
}

def main() = {
["Permute","10", "100"] match {
val debugStartTime : Int = currentTimeNanos();


["Permute","100", "100"] match {
case Cons(x, Cons(y, Cons(z, Nil()))) =>
(x, toInt(y), toInt(z)) match {
case (benchName, Some(iterations), Some(innerIterations)) =>
Expand All @@ -71,5 +74,9 @@ def main() = {
}
case other => println("usage: <benchmark> <iterations> <innerIterations>");
}

val diff = currentTimeNanos() - debugStartTime;
val runTime = diff/1000;
println("DEBUG: runner total took: " ++ show(runTime) ++ " us");
}

0 comments on commit cc66437

Please sign in to comment.