Skip to content

Instantly share code, notes, and snippets.

@debop
Last active December 10, 2015 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debop/4499709 to your computer and use it in GitHub Desktop.
Save debop/4499709 to your computer and use it in GitHub Desktop.
run unit as parallel
private final val LowerBound: Int = 0
private final val UpperBound: Int = 100000
@Test
def runUnitAsParallelTest {
def runnable = {
(LowerBound to UpperBound).foreach {
i => Hero.findRoot(i)
}
log.debug("Unit: FindRoot({}) returns [{}]", UpperBound, Hero.findRoot(UpperBound))
Hero.findRoot(UpperBound)
}
val stopwatch: AutoStopwatch = new AutoStopwatch()
ParallelTestTool.runUnitAsParallel(100) { runnable; runnable }
stopwatch.close()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment