Tick API

Includes:
"APSCommonServices.h"
"APSDebugServices.h"
<time.h>
<sys/time.h>

Introduction

APIs for providing a high-resolution, low-latency tick counter and conversions.



Groups

Tick counter access.

Provides access to the raw tick counter, ticks per second, and convenience functions for common units.

Discussion

If your platform is not already supported then you can implement UpTicks() and UpTicksPerSecond() in your own file and link it in. Alternatively, if you have an existing API and want to avoid the overhead of wrapping your function then you can define TickUtils_PLATFORM_HEADER to point to your custom header file and inside that file you can define UpTicks() and UpTicksPerSecond() to point to your existing functions. This assumes they are API compatible.

Implementors of these APIs must be careful to avoid temporary integer overflows. Even with 64-bit values, it's easy to exceed the range of a 64-bit value when conversion to/from very small units or very large counts.

Group members:

UpTicks

Monotonically increasing number of ticks since the system started.

UpTicksPerSecond

Number of ticks per second


Functions

UpTicks

Monotonically increasing number of ticks since the system started.

UpTicksPerSecond

Number of ticks per second


UpTicks


Monotonically increasing number of ticks since the system started.

uint64_t UpTicks(
    void );  
Discussion

This function returns current value of a monotonically increasing tick counter.


UpTicksPerSecond


Number of ticks per second

uint64_t UpTicksPerSecond(
    void );  
Discussion

This function returns number of ticks per second