1PMTIMEVAL(3)               Library Functions Manual               PMTIMEVAL(3)
2
3
4

NAME

6       pmtimevalNow,  pmtimevalInc,  pmtimevalDec, pmtimevalAdd, pmtimevalSub,
7       pmtimevalToReal, pmtimevalFromReal, pmPrintStamp, pmPrintHighResStamp -
8       helper routines for time stored as a struct timeval
9

C SYNOPSIS

11       #include <pcp/pmapi.h>
12
13       void pmtimevalNow(struct timeval *tv);
14       void pmtimevalInc(struct timeval *ap, const struct timeval *bp);
15       void pmtimevalDec(struct timeval *ap, const struct timeval *bp);
16       double  pmtimevalAdd(const  struct  timeval  *ap,  const struct timeval
17       *bp);
18       double pmtimevalSub(const struct  timeval  *ap,  const  struct  timeval
19       *bp);
20       double pmtimevalToReal(const struct timeval *val);
21       void pmtimevalFromReal(double secs, struct timeval *val);
22       void pmPrintStamp(FILE *f, const struct timeval *tp);
23       void pmPrintHighResStamp(FILE *f, const struct timespec *tp);
24
25       cc ... -lpcp
26

DESCRIPTION

28       pmtimevalNow  is a platform-independent method that returns the current
29       system time since the Epoch in tv.
30
31       pmtimevalInc adds the time in ap to the  time  in  bp  and  stores  the
32       result in ap.  Similarly pmtimevalDec subtracts the time in bp from the
33       time in ap and stores the result in ap.
34
35       pmtimevalAdd (and pmtimevalSub) add (and subtract) times and return the
36       result as a double value.  The time in the ap argument is not changed.
37
38       pmtimevalToReal  converts the time in tp to an equivalent double value.
39       pmtimevalFromReal provides the reverse conversion, taking the  time  in
40       secs and returning the equivalent time in val.
41
42       pmPrintStamp  prints the timestamp from tp on the stream f in the local
43       time (as  returned  by  pmLocaltime(3))  in  the  format  HH:MM:SS.XXX.
44       pmPrintHighResStamp  performs a similar service, but for a struct time‐
45       spec and reports the timestamp to nanosecond precision.
46

SEE ALSO

48       gettimeofday(2), time(2), PMAPI(3) and pmLocaltime(3).
49
50
51
52Performance Co-Pilot                  PCP                         PMTIMEVAL(3)
Impressum