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

NAME

6       pmtimevalNow,  pmtimevalInc,  pmtimevalDec, pmtimevalAdd, pmtimevalSub,
7       pmtimevalToReal, pmtimevalFromReal, pmPrintStamp - helper routines  for
8       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
24       cc ... -lpcp
25

DESCRIPTION

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

NOTES

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

SEE ALSO

49       gettimeofday(2),  time(2),  PMAPI(3),  pmLocaltime(3)  and  pmtimespec‐
50       Now(3).
51
52
53
54Performance Co-Pilot                  PCP                      PMTIMEVALNOW(3)
Impressum