mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
stopwatches: fix a few places that would call start/stop multiple times
This commit is contained in:
parent
85162d90d1
commit
2f33bafd5a
4 changed files with 6 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue