mirror of
https://github.com/Z3Prover/z3
synced 2025-04-13 04:28:17 +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() {
|
||||
reset();
|
||||
dealloc(m_stopwatch);
|
||||
}
|
||||
|
||||
void execution_context::reset() {
|
||||
|
@ -104,15 +103,15 @@ namespace datalog {
|
|||
m_timelimit_ms = time_in_ms;
|
||||
if (!m_stopwatch) {
|
||||
m_stopwatch = alloc(stopwatch);
|
||||
} else {
|
||||
m_stopwatch->stop();
|
||||
m_stopwatch->reset();
|
||||
}
|
||||
m_stopwatch->stop();
|
||||
m_stopwatch->reset();
|
||||
m_stopwatch->start();
|
||||
}
|
||||
void execution_context::reset_timelimit() {
|
||||
if (m_stopwatch) {
|
||||
m_stopwatch->stop();
|
||||
}
|
||||
dealloc(m_stopwatch);
|
||||
m_stopwatch = nullptr;
|
||||
m_timelimit_ms = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -515,7 +515,6 @@ namespace sat {
|
|||
reinit();
|
||||
DEBUG_CODE(verify_slack(););
|
||||
timer timer;
|
||||
timer.start();
|
||||
unsigned step = 0, total_flips = 0, tries = 0;
|
||||
|
||||
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_next_progress_sample = 0;
|
||||
TRACE("literal_occ", display_literal_num_occs(tout););
|
||||
m_timer.start();
|
||||
}
|
||||
|
||||
void context::end_search() {
|
||||
|
|
|
@ -27,7 +27,7 @@ Revision History:
|
|||
class timer {
|
||||
stopwatch m_watch;
|
||||
public:
|
||||
void start() {
|
||||
timer() {
|
||||
m_watch.start();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue