Skip to content
Snippets Groups Projects
Commit 7e3ac13c authored by Nicolas Voirol's avatar Nicolas Voirol
Browse files

Added timers debug to Main

parent 63d9ea28
No related branches found
No related tags found
No related merge requests found
......@@ -147,20 +147,26 @@ object Main extends MainHelpers {
import program.ctx._
import SolverResponses._
SimpleSolverAPI(SolverFactory.default(program)).solveSAT(expr) match {
val error = SimpleSolverAPI(SolverFactory.default(program)).solveSAT(expr) match {
case SatWithModel(model) =>
reporter.info(" => SAT")
for ((vd, res) <- model) {
reporter.info(f"${vd.asString}%-15s -> ${res.asString}")
}
exit(error = false)
false
case Unsat =>
reporter.info(" => UNSAT")
exit(error = false)
false
case Unknown =>
reporter.info(" => UNKNOWN")
exit(error = true)
true
}
reporter.whenDebug(utils.DebugSectionTimers) { debug =>
timers.outputTable(debug)
}
exit(error = error)
}
}
}
......
......@@ -5,6 +5,8 @@ package utils
import scala.language.dynamics
object DebugSectionTimers extends DebugSection("timers")
/** Implements a timer for profiling purposes */
class Timer() {
var beginning: Long = 0L
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment