Core/HostTiming: Allow events to be advanced manually.
This commit is contained in:
parent
1f7dd36499
commit
49a7e0984a
4 changed files with 47 additions and 31 deletions
|
@ -110,7 +110,7 @@ Fiber::Fiber(std::function<void(void*)>&& entry_point_func, void* start_paramete
|
|||
FiberStartFunc);
|
||||
}
|
||||
|
||||
Fiber::Fiber() : guard{}, entry_point{}, start_parameter{}, previous_fiber{} {
|
||||
Fiber::Fiber() {
|
||||
impl = std::make_unique<FiberImpl>();
|
||||
}
|
||||
|
||||
|
|
|
@ -42,14 +42,15 @@ public:
|
|||
|
||||
u64 GetClockCycles() override {
|
||||
std::chrono::nanoseconds time_now = GetTimeNS();
|
||||
const u128 temporal = Common::Multiply64Into128(time_now.count(), emulated_clock_frequency);
|
||||
return Common::Divide128On32(temporal, 1000000000).first;
|
||||
const u128 temporary =
|
||||
Common::Multiply64Into128(time_now.count(), emulated_clock_frequency);
|
||||
return Common::Divide128On32(temporary, 1000000000).first;
|
||||
}
|
||||
|
||||
u64 GetCPUCycles() override {
|
||||
std::chrono::nanoseconds time_now = GetTimeNS();
|
||||
const u128 temporal = Common::Multiply64Into128(time_now.count(), emulated_cpu_frequency);
|
||||
return Common::Divide128On32(temporal, 1000000000).first;
|
||||
const u128 temporary = Common::Multiply64Into128(time_now.count(), emulated_cpu_frequency);
|
||||
return Common::Divide128On32(temporary, 1000000000).first;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue