pmtimevalNow - Man Page

helper routines for time stored as a struct timeval

C Synopsis

#include <pcp/pmapi.h>

void pmtimevalNow(struct timeval *tv);
void pmtimevalInc(struct timeval *ap, const struct timeval *bp);
void pmtimevalDec(struct timeval *ap, const struct timeval *bp);
double pmtimevalAdd(const struct timeval *ap, const struct timeval *bp);
double pmtimevalSub(const struct timeval *ap, const struct timeval *bp);
double pmtimevalToReal(const struct timeval *val);
void pmtimevalFromReal(double secs, struct timeval *val);
void pmtimevalTotimespec(struct timeval *tvp, struct timespec *tsp);
void pmtimevalPrint(FILE *f, const struct timeval *tp);

cc ... -lpcp

Description

pmtimevalNow is a platform-independent method that returns the current system time since the Epoch in tv.

pmtimevalInc adds the time in ap to the time in bp and stores the result in ap. Similarly pmtimevalDec subtracts the time in bp from the time in ap and stores the result in ap.

pmtimevalAdd (and pmtimevalSub) add (and subtract) times and return the result as a double value. The time in the ap argument is not changed.

pmtimevalToReal converts the time in tp to an equivalent double value. pmtimevalFromReal provides the reverse conversion, taking the time in secs and returning the equivalent time in val.

pmtimevalTotimespec converts the struct timeval tvp into an equivalent struct timespec tsp (modulo rounding microseconds up to nanoseconds).

pmtimevalPrint prints the timestamp from tp on the stream f in the local time (as returned by pmLocaltime(3)) in the format HH:MM:SS.XXX.

Notes

For variants of these interfaces using nanosecond precision and the timespec structure, refer to pmtimespecNow(3).

Compatibility

Prior to PCP 7.0 the routine pmtimevalPrint was called pmPrintStamp. To support PMAPI transition, the old routine can still be used if applications are recompiled with -DPMAPI_VERSION=2.

pmPrintStamp is now deprecated and compile-time support for this routine name will be removed in a future release.

See Also

gettimeofday(2), time(2), PMAPI(3), pmLocaltime(3) and pmtimespecNow(3).

Referenced By

pmtimespecNow(3).

The man pages pmtimevalAdd(3), pmtimevalDec(3), pmtimevalFromReal(3), pmtimevalInc(3), pmtimevalPrint(3), pmtimevalSub(3), pmtimevalToReal(3) and pmtimevalTotimespec(3) are aliases of pmtimevalNow(3).

PCP Performance Co-Pilot