56 typedef unsigned int time_tClock;
57 typedef pwr_tTime time_tOs;
88 time_ePeriod_UserDefined,
89 time_ePeriod_OneSecond,
90 time_ePeriod_10Seconds,
91 time_ePeriod_OneMinute,
92 time_ePeriod_10Minutes,
96 time_ePeriod_OneMonth,
98 time_ePeriod_LastSecond,
99 time_ePeriod_Last10Seconds,
100 time_ePeriod_LastMinute,
101 time_ePeriod_Last10Minutes,
102 time_ePeriod_LastHour,
104 time_ePeriod_Yesterday,
105 time_ePeriod_ThisWeek,
106 time_ePeriod_LastWeek,
107 time_ePeriod_ThisMonth,
108 time_ePeriod_LastMonth,
109 time_ePeriod_ThisYear,
110 time_ePeriod_AllTime,
121 #if defined(OS_MACOS)
122 #define CLOCK_REALTIME 1
123 #define CLOCK_MONOTONIC 2
124 typedef int clockid_t;
126 int clock_gettime(clockid_t clockid,
struct timespec* ts);
128 int clock_getres(clockid_t clockid,
struct timespec* tp);
138 pwr_tTime* time_Aabs(pwr_tTime*, pwr_tTime*);
145 pwr_tTime* time_Aneg(pwr_tTime*, pwr_tTime*);
165 pwr_tStatus time_FormAsciiToA(
const char*,
short,
short, pwr_tTime*);
166 void time_AtoFormAscii(pwr_tTime*,
short,
short,
char[],
int);
179 time_tOs* time_AtoOs(
pwr_tStatus*, time_tOs*, pwr_tTime*);
182 void time_Sleep(
float time);
186 int time_PeriodPreviousMonth(pwr_tTime* time, pwr_tTime* from, pwr_tTime* to);
189 void time_Period(time_ePeriod period, pwr_tTime* from, pwr_tTime* to,
190 pwr_tTime* center,
int daybreak);
191 void time_PreviousPeriod(time_ePeriod period, pwr_tTime* prev_from,
192 pwr_tTime* prev_to, pwr_tTime* from, pwr_tTime* to);
193 void time_NextPeriod(time_ePeriod period, pwr_tTime* prev_from,
194 pwr_tTime* prev_to, pwr_tTime* from, pwr_tTime* to);
195 int time_PeriodZoomIn(time_ePeriod* period);
196 int time_PeriodZoomOut(time_ePeriod* period);
197 int time_PrintA(
const char* format, pwr_tTime* ts);
time_eFormat
Time string format.
@ time_eFormat_NumDateAndTime
Date and time format, 2005-01-01 00:00:00.
@ time_eFormat_ComprDateAndTime
Date and time compressed format, 70-01-01 00:00:00.
@ time_eFormat_TimeAndDate
Time and date format, 01:00:00 30/01/87.
@ time_eFormat_Time
Display time only 01:00:00.00.
@ time_eFormat_FileDateAndTime
Date and time format, 20050101_000000.
@ time_eFormat_DateAndTime
Display date and time, 01-JAN-1970 01:00:00.00.
@ time_eFormat_FileDate
Date format, 20050101.
@ time_eFormat_DateAndTimeLoc
Display date and time with local month.
pwr_tStatus time_AsciiToA(const char *, pwr_tTime *)
Convert ascii time to timespec.
pwr_tDeltaTime * time_Float64ToD(pwr_tDeltaTime *, pwr_tFloat64)
Convert double to time.
int time_IsNull(pwr_tTime *t1)
Test if time is Null.
pwr_tDeltaTime * time_ClockToD(pwr_tStatus *, pwr_tDeltaTime *, time_tClock)
Convert clock time to delta time.
pwr_tStatus time_AsciiToD(const char *, pwr_tDeltaTime *)
Convert ascii to timespec.
pwr_tDeltaTime * time_Dneg(pwr_tDeltaTime *, pwr_tDeltaTime *)
Negate a delta time,.
pwr_tDeltaTime * time_FloatToD(pwr_tDeltaTime *, pwr_tFloat32)
Convert float to time.
pwr_tStatus time_DtoAscii(pwr_tDeltaTime *, int, char *, int)
Convert a delta time to ascii string.
int time_GetTimeMonotonic(pwr_tTime *ts)
Get current monotonic time.
pwr_tDeltaTime * time_Dadd(pwr_tDeltaTime *, pwr_tDeltaTime *, pwr_tDeltaTime *)
Add two delta times, the result is also delta.
int time_GetTime(pwr_tTime *ts)
Get current time.
pwr_tDeltaTime * time_Dsub(pwr_tDeltaTime *, pwr_tDeltaTime *, pwr_tDeltaTime *)
Subtract two delta times.
pwr_tTime * time_Aadd_NE(pwr_tTime *, pwr_tTime *, pwr_tDeltaTime *)
Add an absolute time and a delta time.
pwr_tStatus time_AsciiToTm(const char *, struct tm *)
Convert timestring to struct.
pwr_tDeltaTime * time_ZeroD(pwr_tDeltaTime *)
Zero a delta time.
int time_PeriodPreviousWeek(pwr_tTime *time, pwr_tTime *from, pwr_tTime *to)
Calculate start and end time for previous week.
time_tClock time_DtoClock(pwr_tStatus *, pwr_tDeltaTime *)
Convert delta time to clock time.
int time_Dcomp(pwr_tDeltaTime *, pwr_tDeltaTime *)
Compare two delta times.
pwr_tDeltaTime * time_Dabs_NE(pwr_tDeltaTime *, pwr_tDeltaTime *)
Take the absolute walue of a delta time.
pwr_tDeltaTime * time_MsToD(pwr_tDeltaTime *, pwr_tInt32)
Convert millisec to timespec.
pwr_tDeltaTime * time_Dadd_NE(pwr_tDeltaTime *, pwr_tDeltaTime *, pwr_tDeltaTime *)
Add two delta times, the result is also delta.
int time_PrintA(const char *format, pwr_tTime *ts)
Print an absolute time. The format should contain s.
pwr_tTime * time_Asub(pwr_tTime *, pwr_tTime *, pwr_tDeltaTime *)
Subtract a delta time from a time,.
void time_PreviousDayBreak(pwr_tTime *time, pwr_tTime *daybreak)
Calculate previous daybreak.
int time_Acomp_NE(pwr_tTime *, pwr_tTime *)
Compare two timespecs.
char * time_GetTimeAscii(time_eFormat format)
Get current time in ascii.
pwr_tDeltaTime * time_Adiff_NE(pwr_tDeltaTime *, pwr_tTime *, pwr_tTime *)
Subtract a time from a time,.
pwr_tStatus time_AtoAscii(pwr_tTime *, time_eFormat, char *, int)
Convert timespec to ascii.
pwr_tFloat64 time_DToFloat64(pwr_tFloat64 *, pwr_tDeltaTime *)
Convert time to Float64.
pwr_tDeltaTime * time_Dabs(pwr_tDeltaTime *, pwr_tDeltaTime *)
Take the absolute walue of a delta time.
int time_Acomp(pwr_tTime *, pwr_tTime *)
Compare two timespecs.
int time_Dcomp_NE(pwr_tDeltaTime *, pwr_tDeltaTime *)
Compare two delta times.
pwr_tDeltaTime * time_Adiff(pwr_tDeltaTime *, pwr_tTime *, pwr_tTime *)
Subtract a time from a time,.
pwr_tDeltaTime * time_Dsub_NE(pwr_tDeltaTime *, pwr_tDeltaTime *, pwr_tDeltaTime *)
Subtract two delta times.
pwr_tFloat32 time_DToFloat(pwr_tFloat32 *, pwr_tDeltaTime *)
Convert time to Float32.
pwr_tStatus time_TmToAscii(struct tm *, time_eFormat, char *, int)
Convert time struct to string.
pwr_tFloat32 time_AdiffToFloat(pwr_tTime *t, pwr_tTime *s)
Subtract a time from a time and return the differens.
pwr_tTime * time_Asub_NE(pwr_tTime *, pwr_tTime *, pwr_tDeltaTime *)
Subtract a delta time from a time,.
pwr_tTime * time_Aadd(pwr_tTime *, pwr_tTime *, pwr_tDeltaTime *)
Add an absolute time and a delta time.
pwr_tDeltaTime * time_Dneg_NE(pwr_tDeltaTime *, pwr_tDeltaTime *)
Negate a delta time,.
Basic type definitions. This include file contains the Proview basic type definitions.
double pwr_tFloat64
64-bit float.
int pwr_tInt32
32-bit integer type.
int pwr_tStatus
Status type.
float pwr_tFloat32
32-bit float.