-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace util/timer* with std::chrono
The old timer API was written in 2004 and is superseded by std::chrono. All clients of the old API are updated to use std::chrono, and the old API classes are removed. This is in preparation for a commit that uses features of chrono that are not present in the old time API.
- Loading branch information
Showing
10 changed files
with
38 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,8 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "all_properties_class.h" | ||
|
||
#include <util/time_stopping.h> | ||
#include <chrono> | ||
|
||
#include <util/xml.h> | ||
#include <util/json.h> | ||
|
||
|
@@ -56,8 +57,8 @@ safety_checkert::resultt bmc_all_propertiest::operator()() | |
|
||
solver.set_message_handler(get_message_handler()); | ||
|
||
// stop the time | ||
absolute_timet sat_start=current_time(); | ||
auto now = std::chrono::steady_clock::now(); | ||
auto sat_start = std::chrono::time_point_cast<std::chrono::seconds>(now); | ||
|
||
bmc.do_conversion(); | ||
|
||
|
@@ -131,12 +132,12 @@ safety_checkert::resultt bmc_all_propertiest::operator()() | |
g.second.status=goalt::statust::SUCCESS; | ||
} | ||
|
||
// output runtime | ||
|
||
{ | ||
absolute_timet sat_stop=current_time(); | ||
status() << "Runtime decision procedure: " | ||
<< (sat_stop-sat_start) << "s" << eom; | ||
now = std::chrono::steady_clock::now(); | ||
auto sat_stop = std::chrono::time_point_cast<std::chrono::seconds>(now); | ||
|
||
status() << "Runtime decision procedure: " << (sat_stop - sat_start).count() | ||
<< "s" << eom; | ||
} | ||
|
||
// report | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,14 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "bmc.h" | ||
|
||
#include <chrono> | ||
#include <fstream> | ||
#include <iostream> | ||
#include <memory> | ||
|
||
#include <util/string2int.h> | ||
#include <util/source_location.h> | ||
#include <util/string_utils.h> | ||
#include <util/time_stopping.h> | ||
#include <util/message.h> | ||
#include <util/json.h> | ||
#include <util/cprover_prefix.h> | ||
|
@@ -154,20 +154,20 @@ bmct::run_decision_procedure(prop_convt &prop_conv) | |
|
||
prop_conv.set_message_handler(get_message_handler()); | ||
|
||
// stop the time | ||
absolute_timet sat_start=current_time(); | ||
auto now = std::chrono::steady_clock::now(); | ||
auto sat_start = std::chrono::time_point_cast<std::chrono::seconds>(now); | ||
|
||
do_conversion(); | ||
|
||
status() << "Running " << prop_conv.decision_procedure_text() << eom; | ||
|
||
decision_proceduret::resultt dec_result=prop_conv.dec_solve(); | ||
// output runtime | ||
|
||
{ | ||
absolute_timet sat_stop=current_time(); | ||
status() << "Runtime decision procedure: " | ||
<< (sat_stop-sat_start) << "s" << eom; | ||
now = std::chrono::steady_clock::now(); | ||
auto sat_stop = std::chrono::time_point_cast<std::chrono::seconds>(now); | ||
status() << "Runtime decision procedure: " << (sat_stop - sat_start).count() | ||
<< "s" << eom; | ||
} | ||
|
||
return dec_result; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,8 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "bmc.h" | ||
|
||
#include <util/time_stopping.h> | ||
#include <chrono> | ||
|
||
#include <util/xml.h> | ||
#include <util/xml_expr.h> | ||
#include <util/json.h> | ||
|
@@ -191,8 +192,8 @@ bool bmc_covert::operator()() | |
|
||
solver.set_message_handler(get_message_handler()); | ||
|
||
// stop the time | ||
absolute_timet sat_start=current_time(); | ||
auto now = std::chrono::steady_clock::now(); | ||
auto sat_start = std::chrono::time_point_cast<std::chrono::seconds>(now); | ||
|
||
// Collect _all_ goals in `goal_map'. | ||
// This maps property IDs to 'goalt' | ||
|
@@ -251,12 +252,11 @@ bool bmc_covert::operator()() | |
|
||
cover_goals(); | ||
|
||
// output runtime | ||
|
||
{ | ||
absolute_timet sat_stop=current_time(); | ||
status() << "Runtime decision procedure: " | ||
<< (sat_stop-sat_start) << "s" << eom; | ||
now = std::chrono::steady_clock::now(); | ||
auto sat_stop = std::chrono::time_point_cast<std::chrono::seconds>(now); | ||
status() << "Runtime decision procedure: " << (sat_stop - sat_start).count() | ||
<< "s" << eom; | ||
} | ||
|
||
// report | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.