File tree 2 files changed +9
-9
lines changed
2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ class Timer
6
6
{
7
7
private:
8
8
bool m_stopped;
9
- std::chrono::high_resolution_clock ::time_point m_start;
10
- std::chrono::high_resolution_clock ::time_point m_end;
9
+ std::chrono::steady_clock ::time_point m_start;
10
+ std::chrono::steady_clock ::time_point m_end;
11
11
12
12
public:
13
13
Timer () : m_stopped(false )
@@ -17,13 +17,13 @@ class Timer
17
17
void Start ()
18
18
{
19
19
m_stopped = false ;
20
- m_start = std::chrono::high_resolution_clock ::now ();
20
+ m_start = std::chrono::steady_clock ::now ();
21
21
}
22
22
23
23
void Stop ()
24
24
{
25
25
m_stopped = true ;
26
- m_end = std::chrono::high_resolution_clock ::now ();
26
+ m_end = std::chrono::steady_clock ::now ();
27
27
}
28
28
29
29
double GetElapsedTimeInSec () const
@@ -38,14 +38,14 @@ class Timer
38
38
39
39
u64 GetElapsedTimeInMicroSec () const
40
40
{
41
- std::chrono::high_resolution_clock ::time_point now = m_stopped ? m_end : std::chrono::high_resolution_clock ::now ();
41
+ std::chrono::steady_clock ::time_point now = m_stopped ? m_end : std::chrono::steady_clock ::now ();
42
42
43
43
return std::chrono::duration_cast<std::chrono::microseconds>(now - m_start).count ();
44
44
}
45
45
46
46
u64 GetElapsedTimeInNanoSec () const
47
47
{
48
- std::chrono::high_resolution_clock ::time_point now = m_stopped ? m_end : std::chrono::high_resolution_clock ::now ();
48
+ std::chrono::steady_clock ::time_point now = m_stopped ? m_end : std::chrono::steady_clock ::now ();
49
49
50
50
return std::chrono::duration_cast<std::chrono::nanoseconds>(now - m_start).count ();
51
51
}
Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ void LogFrame::OnTimer(wxTimerEvent& event)
264
264
return wxString::FromUTF8 (buf.data (), size);
265
265
};
266
266
267
- const auto start = std::chrono::high_resolution_clock ::now ();
267
+ const auto start = steady_clock ::now ();
268
268
269
269
// Check TTY logs
270
270
while (const u64 size = std::min<u64>(sizeof (buf), m_tty_file.size () - m_tty_file.pos ()))
@@ -274,7 +274,7 @@ void LogFrame::OnTimer(wxTimerEvent& event)
274
274
if (get_cfg_tty ()) m_tty->AppendText (text);
275
275
276
276
// Limit processing time
277
- if (std::chrono::high_resolution_clock ::now () >= start + 4ms || text.empty ()) break ;
277
+ if (steady_clock ::now () >= start + 4ms || text.empty ()) break ;
278
278
}
279
279
280
280
// Check main logs
@@ -309,6 +309,6 @@ void LogFrame::OnTimer(wxTimerEvent& event)
309
309
s_gui_listener.pop ();
310
310
311
311
// Limit processing time
312
- if (std::chrono::high_resolution_clock ::now () >= start + 7ms) break ;
312
+ if (steady_clock ::now () >= start + 7ms) break ;
313
313
}
314
314
}
You can’t perform that action at this time.
0 commit comments