// Functionality:
// Sleep for "interval" CCs.
// Parameters:
// 0) [in] interval: CCs to sleep.
// Returned value:
// None.
void sleep(const uint64_t& interval);
// Functionality:
// Seelp until CC "nexttime".
// Parameters:
// 0) [in] nexttime: next time the caller is waken up.
// Returned value:
// None.
void sleepto(const uint64_t& nexttime);
// Functionality:
// Stop the sleep() or sleepto() methods.
// Parameters:
// None.
// Returned value:
// None.
void interrupt();
// Functionality:
// trigger the clock for a tick, for better granuality in no_busy_waiting timer.
// Parameters:
// None.
// Returned value:
// None.
void tick();
public:
// Functionality:
// Read the CPU clock cycle into x.
// Parameters:
// 0) [out] x: to record cpu clock cycles.
// Returned value:
// None.
static void rdtsc(uint64_t &x);
// Functionality:
// return the CPU frequency.
// Parameters:
// None.
// Returned value:
// CPU frequency.
static uint64_t getCPUFrequency();
// Functionality:
// check the current time, 64bit, in microseconds.
// Parameters:
// None.
// Returned value:
// current time in microseconds.
static uint64_t getTime();
// Functionality:
// trigger an event such as new connection, close, new data, etc. for "select" call.
// Parameters:
// None.
// Returned value:
// None.
static void triggerEvent();
// Functionality:
// wait for an event to br triggered by "triggerEvent".
// Parameters:
// None.
// Returned value:
// None.
static void waitForEvent();
private:
uint64_t m_ullSchedTime; // next schedulled time