Skip to content

Commit 80c47e3

Browse files
committed
Now introduce read()
1 parent a43ec59 commit 80c47e3

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

highs/ipm/ipx/timer.cc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,28 @@ namespace ipx {
44

55
Timer::Timer(const double offset)
66
: offset_(offset) {
7-
if (offset_) printf("Timer::Timer offset_ = %g\n", offset_);
87
Reset(true);
9-
if (offset_) printf("Timer::Timer offset_ = %g\n", offset_);
108
}
119

1210
double Timer::Elapsed() const {
1311
return toc(t0_);
1412
}
1513

1614
void Timer::Reset(const bool first) {
17-
using namespace std::chrono;
18-
double prev_offset = offset_;
1915
if (!first)
2016
offset_ -= duration_cast<duration<double>>(t0_.time_since_epoch()).count();
2117
t0_ = tic();
2218
if (!first)
2319
offset_ += duration_cast<duration<double>>(t0_.time_since_epoch()).count();
24-
if (offset_) printf("Timer::Reset offset goes from %g to %g\n", prev_offset, offset_);
2520
}
2621

2722
Timer::TimePoint Timer::tic() {
28-
return std::chrono::high_resolution_clock::now();
23+
return high_resolution_clock::now();
2924
}
3025

3126
double Timer::toc(TimePoint start) {
3227
TimePoint end = tic();
33-
std::chrono::duration<double> diff = end-start;
28+
duration<double> diff = end-start;
3429
return diff.count();
3530
}
3631

highs/ipm/ipx/timer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <chrono>
55

66
namespace ipx {
7+
using namespace std::chrono;
78

89
class Timer {
910
public:
@@ -12,8 +13,7 @@ class Timer {
1213
void Reset(const bool first = false);
1314

1415
private:
15-
typedef std::chrono::time_point<std::chrono::high_resolution_clock>
16-
TimePoint;
16+
typedef time_point<high_resolution_clock> TimePoint;
1717
static TimePoint tic();
1818
static double toc(TimePoint start);
1919
TimePoint t0_;

0 commit comments

Comments
 (0)