Skip to content

Timing functions

Finalspace edited this page May 29, 2026 · 1 revision

This category contains functions for time comparisons. More...

Data Structures

Type Name
struct fplDateTime
Stores a date and time with milliseconds, including the UTC offset. More...
struct fplDateTimeCreationResult
Stores the result of a date time creation. More...
struct fplDateTimeResult
Stores the components for a date and time, that may be computed from a date time stamp. More...
union fplTimestamp
Stores a timestamp, used for delta measurements only. More...

Macros

Type Name
#define FPL_TIMEOUT_INFINITE
Infinite timeout constant.

Typedefs

Type Name
typedef uint64_t fplMilliseconds
A type definition for milliseconds (64-bit).
typedef double fplSeconds
A type definition for seconds (64-bit).
typedef uint32_t fplTimeoutValue
A type definition for a timeout value in milliseconds.

Enumerations

Type Name
enum fplDateTimeErrors {
fplDateTimeErrors_None , fplDateTimeErrors_InvalidYear , fplDateTimeErrors_InvalidMonth , fplDateTimeErrors_InvalidDay ,
fplDateTimeErrors_InvalidHour , fplDateTimeErrors_InvalidMinute , fplDateTimeErrors_InvalidSecond
}
Defines the date time error flags. More...
enum fplDateTimeType { fplDateTimeType_UTC , fplDateTimeType_Local }
Defines the date time types. More...

Functions

Type Name
fpl_common_api fplDateTimeCreationResult fplDateTimeCreate (const uint16_t year, const uint8_t month, const uint8_t day, const uint8_t hour, const uint8_t minute, const uint8_t second, const uint16_t millisecond, const int32_t utcOffset)
Creates a date time from the specified date time components and UTC offset.
fpl_platform_api fplDateTime fplDateTimeQuery (const fplDateTimeType type)
Gets the current date and time in the specified format (UTC or local).
fpl_platform_api fplDateTimeResult fplFormatDateTime (const fplDateTime dateTime, const fplDateTimeType type)
Formats the date time into the specified format as a fplDateTimeResult.
fpl_platform_api fplMilliseconds fplMillisecondsQuery (void)
Gets the current system clock in milliseconds, since some fixed starting point (OS start, System start, etc.), used for time delta measurements only.
fpl_platform_api fplSeconds fplTimestampElapsed (const fplTimestamp start, const fplTimestamp finish)
Gets the delta value from two fplTimestamp values in seconds.
fpl_platform_api fplTimestamp fplTimestampQuery (void)
Gets the current fplTimestamp with most precision, used for time delta measurements only.

Detailed Description

This category contains functions for time comparisons.

Macro Definition Documentation

FPL_TIMEOUT_INFINITE

#define FPL_TIMEOUT_INFINITE

Infinite timeout constant.

Definition at line 4666 of file final_platform_layer.h.

Typedef Documentation

fplMilliseconds

typedef uint64_t fplMilliseconds

A type definition for milliseconds (64-bit).

Definition at line 4678 of file final_platform_layer.h.

fplSeconds

typedef double fplSeconds

A type definition for seconds (64-bit).

Definition at line 4672 of file final_platform_layer.h.

fplTimeoutValue

typedef uint32_t fplTimeoutValue

A type definition for a timeout value in milliseconds.

Definition at line 4660 of file final_platform_layer.h.

Enumeration Type Documentation

fplDateTimeErrors

enum fplDateTimeErrors

Defines the date time error flags.

Name Description
fplDateTimeErrors_None No error.
fplDateTimeErrors_InvalidYear Invalid year, expected range is 1970 or higher.
fplDateTimeErrors_InvalidMonth Invalid month, expected range is 1-12.
fplDateTimeErrors_InvalidDay Invalid day, expected range is 1-31.
fplDateTimeErrors_InvalidHour Invalid hour, expected range is 0-23.
fplDateTimeErrors_InvalidMinute Invalid minute, expected range is 0-59.
fplDateTimeErrors_InvalidSecond Invalid second, expected range is 0-59.

Definition at line 4730 of file final_platform_layer.h.

fplDateTimeType

enum fplDateTimeType

Defines the date time types.

Name Description
fplDateTimeType_UTC UTC type (+0).
fplDateTimeType_Local Local type (+/- offset).

Definition at line 4705 of file final_platform_layer.h.

Function Documentation

fplDateTimeCreate()

fpl_common_api fplDateTimeCreationResult fplDateTimeCreate ( const uint16_t year, const uint8_t month, const uint8_t day, const uint8_t hour, const uint8_t minute, const uint8_t second, const uint16_t millisecond, const int32_t utcOffset )

Creates a date time from the specified date time components and UTC offset.

Parameters

Direction Parameter Description
[in] year The year starting from 1970.
[in] month The month in range of 1-12.
[in] day The day in range of 1-31.
[in] hour The hour in range of 0-23.
[in] minute The minute in range of 0-59.
[in] second The second in range of 0-59.
[in] millisecond The millisecond in range of 0-999.
[in] utcOffset The UTC offset in minutes.

Returns: Returns the created date time structure as

fplDateTime .

Note: If invalid arguments are passed, an empty date time is returned instead.

fplDateTimeQuery()

fpl_platform_api fplDateTime fplDateTimeQuery ( const fplDateTimeType type)

Gets the current date and time in the specified format (UTC or local).

Parameters

Direction Parameter Description
[in] type The target date time format as fplDateTimeType.

Returns: Returns the date time structure as

fplDateTime .

fplFormatDateTime()

fpl_platform_api fplDateTimeResult fplFormatDateTime ( const fplDateTime dateTime, const fplDateTimeType type )

Formats the date time into the specified format as a fplDateTimeResult.

Parameters

Direction Parameter Description
[in] dateTime The date time as fplDateTime.
[in] type The target date time format as fplDateTimeType.

Returns: Returns the computed date time fields as

fplDateTimeResult .

fplMillisecondsQuery()

fpl_platform_api fplMilliseconds fplMillisecondsQuery ( void )

Gets the current system clock in milliseconds, since some fixed starting point (OS start, System start, etc.), used for time delta measurements only.

Returns: Returns the number of milliseconds as

fplMilliseconds .

fplTimestampElapsed()

fpl_platform_api fplSeconds fplTimestampElapsed ( const fplTimestamp start, const fplTimestamp finish )

Gets the delta value from two fplTimestamp values in seconds.

Parameters

Direction Parameter Description
[in] start The starting fplTimestamp.
[in] finish The ending fplTimestamp.

Returns: Returns the resulting elapsed time in seconds as

fplSeconds .

fplTimestampQuery()

fpl_platform_api fplTimestamp fplTimestampQuery ( void )

Gets the current fplTimestamp with most precision, used for time delta measurements only.

Returns: Returns the resulting

fplTimestamp .

Note: Use

fplTimestampElapsed() to get the elapsed time.

Final Platform Layer

Pages

Topics

Data Structures

Clone this wiki locally