summaryrefslogtreecommitdiffhomepage
path: root/Private/Source/Timer.cxx
blob: e802f7349bb0b9382f86fb54337b8cbe43d59352 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 *	========================================================
 *
 *	HCore
 * 	Copyright Mahrouss Logic, all rights reserved.
 *
 * 	========================================================
 */

#include <KernelKit/Timer.hpp>

// bugs = 0

using namespace HCore;

Int32 HardwareTimerInterface::Wait() noexcept { return H_UNIMPLEMENTED; }

HardwareTimer::HardwareTimer(Int64 seconds) : fWaitFor(seconds) {}
HardwareTimer::~HardwareTimer() { fWaitFor = 0; }

Int32 HardwareTimer::Wait() noexcept {
  if (fWaitFor < 1) return -1;

  while (*fDigitalTimer < (*fDigitalTimer + fWaitFor)) {
  }

  return 0;
}