File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
src/machine/memory/backend Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ AclintMtimer::AclintMtimer(Endian simulated_machine_endian)
21
21
value = 0 ;
22
22
}
23
23
24
- mtime_start_offset = QTime::currentTime ();
24
+ clock. start ();
25
25
qt_timer_id = -1 ;
26
26
}
27
27
@@ -31,9 +31,7 @@ AclintMtimer::~AclintMtimer() {
31
31
}
32
32
33
33
uint64_t AclintMtimer::mtime_fetch_current () const {
34
- QTime current_time = QTime::currentTime ();
35
-
36
- mtime_last_current_fetch = mtime_start_offset.msecsTo (current_time) * (uint64_t )10000 ;
34
+ mtime_last_current_fetch = clock.elapsed () * (uint64_t )10000 ;
37
35
38
36
return mtime_last_current_fetch;
39
37
}
Original file line number Diff line number Diff line change 6
6
7
7
#include < QTime>
8
8
#include < cstdint>
9
+ #include < qelapsedtimer.h>
9
10
10
11
namespace machine { namespace aclint {
11
12
@@ -63,8 +64,8 @@ namespace machine { namespace aclint {
63
64
unsigned mtimecmp_count;
64
65
uint64_t mtimecmp_value[ACLINT_MTIMECMP_COUNT_MAX] {};
65
66
67
+ QElapsedTimer clock;
66
68
const uint8_t mtimer_irq_level;
67
- QTime mtime_start_offset;
68
69
uint64_t mtime_user_offset = 0 ;
69
70
mutable uint64_t mtime_last_current_fetch = 0 ;
70
71
mutable bool mtimer_irq_active = false ;
You can’t perform that action at this time.
0 commit comments