mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-07-06 21:09:18 +00:00
Implemented sleep for threads🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
This commit is contained in:
@ -15,7 +15,7 @@ namespace Time
|
||||
void time::Sleep(uint64_t Milliseconds)
|
||||
{
|
||||
#if defined(__amd64__) || defined(__i386__)
|
||||
uintptr_t Target = mminq(&((HPET *)hpet)->MainCounterValue) + (Milliseconds * 1000000000000) / clk;
|
||||
uint64_t Target = mminq(&((HPET *)hpet)->MainCounterValue) + (Milliseconds * 1000000000000) / clk;
|
||||
#ifdef DEBUG
|
||||
uint64_t Counter = mminq(&((HPET *)hpet)->MainCounterValue);
|
||||
while (Counter < Target)
|
||||
@ -31,6 +31,22 @@ namespace Time
|
||||
#endif
|
||||
}
|
||||
|
||||
uint64_t time::GetCounter()
|
||||
{
|
||||
#if defined(__amd64__) || defined(__i386__)
|
||||
return mminq(&((HPET *)hpet)->MainCounterValue);
|
||||
#elif defined(__aarch64__)
|
||||
#endif
|
||||
}
|
||||
|
||||
uint64_t time::CalculateTarget(uint64_t Milliseconds)
|
||||
{
|
||||
#if defined(__amd64__) || defined(__i386__)
|
||||
return mminq(&((HPET *)hpet)->MainCounterValue) + (Milliseconds * 1000000000000) / clk;
|
||||
#elif defined(__aarch64__)
|
||||
#endif
|
||||
}
|
||||
|
||||
time::time(void *_acpi)
|
||||
{
|
||||
if (_acpi)
|
||||
|
Reference in New Issue
Block a user