AuroraRuntime/Include/Aurora/Async/IAsyncTimer.hpp

36 lines
1.1 KiB
C++
Raw Normal View History

/***
Copyright (C) 2023 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: IAsyncTimer.hpp
Date: 2023-12-06
Author: Reece
***/
#pragma once
namespace Aurora::Async
{
struct IAsyncTimer
{
virtual void CancelTimer() = 0;
virtual AuUInt64 GetLastTime() = 0;
/**
* Get tick count (always non-zero after or during initial trigger)
*/
virtual AuUInt64 GetTicks() = 0;
/**
* Default: false
* When in catch up mode, timer ticks can be scheduled in the past, otherwise the next time is clamped to the current time.
* Latterly, it is possible to get stuck in a spin with no interval, however if the system lags behind momentarily, recovery is instantaneous.
* On platforms with process suspension, specify no catch up.
* On servers or other tick-sensitive applications (like a clock GUI), specify catch up.
*/
virtual bool IsCatchUp() = 0;
/**
* See: IsCatchUp
*/
virtual void SetCatchUp(bool bCatchUp) = 0;
};
}