1PMTIMESPECNOW(3) Library Functions Manual PMTIMESPECNOW(3)
2
3
4
6 pmtimespecNow, pmtimespecInc, pmtimespecDec, pmtimespecAdd, pmtimespec‐
7 Sub, pmtimespecToReal, pmtimespecFromReal, pmPrintHighResStamp - helper
8 routines for time stored as a struct timespec
9
11 #include <pcp/pmapi.h>
12
13 void pmtimespecNow(struct timespec *tp);
14 void pmtimespecInc(struct timespec *ap, const struct timespec *bp);
15 void pmtimespecDec(struct timespec *ap, const struct timespec *bp);
16 double pmtimespecAdd(const struct timespec *ap, const struct timespec
17 *bp);
18 double pmtimespecSub(const struct timespec *ap, const struct timespec
19 *bp);
20 double pmtimespecToReal(const struct timespec *tp);
21 void pmtimespecFromReal(double secs, struct timespec *tp);
22 void pmPrintHighResStamp(FILE *f, const struct timespec *tp);
23
24 cc ... -lpcp
25
27 pmtimespecNow is a platform-independent method that returns the current
28 system time since the Epoch in tp.
29
30 pmtimespecInc adds the time in ap to the time in bp and stores the re‐
31 sult in ap. Similarly pmtimespecDec subtracts the time in bp from the
32 time in ap and stores the result in ap.
33
34 pmtimespecAdd (and pmtimespecSub) add (and subtract) times and return
35 the result as a double value. The time in the ap argument is not
36 changed.
37
38 pmtimespecToReal converts the time in tp to an equivalent double value.
39 pmtimespecFromReal provides the reverse conversion, taking the time in
40 secs and returning the equivalent time in tp.
41
42 pmPrintHighResStamp prints the timestamp from tp on the stream f in the
43 local time (as returned by pmLocaltime(3)) in the format
44 HH:MM:SS.XXXXXXXXX.
45
47 For variants of these interfaces using microsecond precision and the
48 timeval structure, refer to pmtimevalNow(3).
49
51 PMAPI(3), pmLocaltime(3) and pmtimevalNow(3).
52
53
54
55Performance Co-Pilot PCP PMTIMESPECNOW(3)