mirror of
https://github.com/Z3Prover/z3
synced 2025-04-14 21:08:46 +00:00
stopwatches: fix a few places that would call start/stop multiple times
This commit is contained in:
parent
85162d90d1
commit
2f33bafd5a
|
@ -41,7 +41,6 @@ namespace datalog {
|
||||||
|
|
||||||
execution_context::~execution_context() {
|
execution_context::~execution_context() {
|
||||||
reset();
|
reset();
|
||||||
dealloc(m_stopwatch);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void execution_context::reset() {
|
void execution_context::reset() {
|
||||||
|
@ -104,15 +103,15 @@ namespace datalog {
|
||||||
m_timelimit_ms = time_in_ms;
|
m_timelimit_ms = time_in_ms;
|
||||||
if (!m_stopwatch) {
|
if (!m_stopwatch) {
|
||||||
m_stopwatch = alloc(stopwatch);
|
m_stopwatch = alloc(stopwatch);
|
||||||
|
} else {
|
||||||
|
m_stopwatch->stop();
|
||||||
|
m_stopwatch->reset();
|
||||||
}
|
}
|
||||||
m_stopwatch->stop();
|
|
||||||
m_stopwatch->reset();
|
|
||||||
m_stopwatch->start();
|
m_stopwatch->start();
|
||||||
}
|
}
|
||||||
void execution_context::reset_timelimit() {
|
void execution_context::reset_timelimit() {
|
||||||
if (m_stopwatch) {
|
dealloc(m_stopwatch);
|
||||||
m_stopwatch->stop();
|
m_stopwatch = nullptr;
|
||||||
}
|
|
||||||
m_timelimit_ms = 0;
|
m_timelimit_ms = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -515,7 +515,6 @@ namespace sat {
|
||||||
reinit();
|
reinit();
|
||||||
DEBUG_CODE(verify_slack(););
|
DEBUG_CODE(verify_slack(););
|
||||||
timer timer;
|
timer timer;
|
||||||
timer.start();
|
|
||||||
unsigned step = 0, total_flips = 0, tries = 0;
|
unsigned step = 0, total_flips = 0, tries = 0;
|
||||||
|
|
||||||
for (tries = 1; !m_unsat_stack.empty() && m_limit.inc(); ++tries) {
|
for (tries = 1; !m_unsat_stack.empty() && m_limit.inc(); ++tries) {
|
||||||
|
|
|
@ -3496,7 +3496,6 @@ namespace smt {
|
||||||
m_case_split_queue ->init_search_eh();
|
m_case_split_queue ->init_search_eh();
|
||||||
m_next_progress_sample = 0;
|
m_next_progress_sample = 0;
|
||||||
TRACE("literal_occ", display_literal_num_occs(tout););
|
TRACE("literal_occ", display_literal_num_occs(tout););
|
||||||
m_timer.start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void context::end_search() {
|
void context::end_search() {
|
||||||
|
|
|
@ -27,7 +27,7 @@ Revision History:
|
||||||
class timer {
|
class timer {
|
||||||
stopwatch m_watch;
|
stopwatch m_watch;
|
||||||
public:
|
public:
|
||||||
void start() {
|
timer() {
|
||||||
m_watch.start();
|
m_watch.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue