orca/src/platform/platform_clock.h

36 lines
944 B
C
Raw Normal View History

2023-09-07 12:51:48 +00:00
/*************************************************************************
*
2023-09-07 12:51:48 +00:00
* Orca
* Copyright 2023 Martin Fouilleul and the Orca project contributors
* See LICENSE.txt for licensing information
*
2023-09-07 12:51:48 +00:00
**************************************************************************/
2023-08-19 12:49:23 +00:00
#ifndef __PLATFORM_CLOCK_H_
#define __PLATFORM_CLOCK_H_
#include "platform.h"
#include "util/typedefs.h"
#ifdef __cplusplus
2023-09-06 09:04:17 +00:00
extern "C" {
2023-08-19 12:49:23 +00:00
#endif // __cplusplus
2023-09-06 09:04:17 +00:00
typedef enum
{
OC_CLOCK_MONOTONIC, // clock that increment monotonically
OC_CLOCK_UPTIME, // clock that increment monotonically during uptime
OC_CLOCK_DATE // clock that is driven by the platform time
} oc_clock_kind;
#if !defined(OC_PLATFORM_ORCA) || !OC_PLATFORM_ORCA
ORCA_API void oc_clock_init(); // initialize the clock subsystem
#endif
2023-08-19 12:49:23 +00:00
2023-09-06 09:04:17 +00:00
ORCA_API f64 oc_clock_time(oc_clock_kind clock);
2023-08-19 12:49:23 +00:00
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif //__PLATFORM_CLOCK_H_