Content-type: text/html Manpage of RTClock

RTClock

Section: Chronolytix (3)
Updated: 2005-07-07
Index Return to Main Contents
 

NAME

RTClock - Chronolytix Clock class  

SYNOPSYS

#include <RTClock.h>

typedef unsigned long long RTClockCount;

typedef unsigned long RTClockMicroSecs;

RTClockCount RTClock_ReadClockCounter();

char *RTClock_Micro_ctime_r(struct timeval *tv, char *buf);

struct timeval *RTClock_GetTimeOfDay(struct timeval *tv, struct timezone *tz);

struct timeval *RTClock_GetTimeOfDay_ClockCount(struct timeval *tv, RTClockCount ticks);

void RTClock_SetBaseTimeOfDay(struct timeval *tv);

void RTClock_GetBaseTimeOfDay(struct timeval *tv);

void RTClock_Sync(RTClockCount *now, struct timeval *tv);

RTClockMicroSecs RTClockCount_to_RTClockMicroSecs(RTClockCount ticks);

RTClockCount RTClockMicroSecs_to_RTClockClock(RTClockMicroSecs usec);

 

DESCRIPTION

RTClockCount is the type of the time base for Chronolytix. It is assumed to be a high resolution time base and is guaranteed to be maximum interval of 1mS. On architectures that support it, the RTClockCount is a counter tied to the CPU clock. On the i386 (Pentium) architecture, there is a 64 bit register (TSC) which is used for the RTClockCount. RTClockMicroSecs is the "portable" time base for many calls within the Chronolytix system. The RTClock_ReadClockCounter reads the current value of the counter. On the i386 Pentium architecture, this is an inlined rdtsc call. RTClock_Micro_ctime_r is analogous to the c-library ctime_r(3). However, this call replaces the timezone and the year in the ctime string with the microseconds present in the timeval. The required reentrant buffer must be of size RTCLOCK_CTIME_BUFSIZE.

RTClock_GetTimeOfDay and RTClock_GetTimeOfDay_ClockCount return an RTClockCount based time of day. RTClock_GetTimeOfDay implicitly reads the RTClockCount whereas RTClock_GetTimeOfDay_ClockCount uses the supplied ticks parameter. RTClock_GetBaseTimeOfDay, RTClock_SetBaseTimeOfDay and RTClock_Sync are used to get/set the base time epoch which is initialized early in Chronolytix system init. These are used to synchronized to external clocks or to adjust drift from another timebase such as gettimeofday(2). RTClockCount_to_RTClockMicroSecs and RTClockMicroSecs_to_RTClockClock are conversion routines for manipulating the two Chronolytix time bases.

RTClock is a Chronolytix core function.  

MAGIC

none  

BUGS

 

SEE ALSO

RTTimer(Chronolytix)


 

Index

NAME
SYNOPSYS
DESCRIPTION
MAGIC
BUGS
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 20:18:30 GMT, August 26, 2005