logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

pmtimespecNow, pmtimespecInc, pmtimespecDec, pmtimespecAdd, pmtimespecSub, pmtimespecToReal,

C Synopsis

#include<pcp/pmapi.h>voidpmtimespecNow(structtimespec*tp);voidpmtimespecInc(structtimespec*ap,conststructtimespec*bp);voidpmtimespecDec(structtimespec*ap,conststructtimespec*bp);doublepmtimespecAdd(conststructtimespec*ap,conststructtimespec*bp);doublepmtimespecSub(conststructtimespec*ap,conststructtimespec*bp);doublepmtimespecToReal(conststructtimespec*tp);voidpmtimespecFromReal(doublesecs,structtimespec*tp);voidpmPrintHighResStamp(FILE*f,conststructtimespec*tp);cc...-lpcp

Description

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

       pmtimespecInc adds the time in ap to the time in bp and stores the result in ap.  Similarly pmtimespecDec
       subtracts the time in bp from the time in ap and stores the result in ap.

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

       pmtimespecToReal converts the time in tp to an equivalent double value.  pmtimespecFromReal provides  the
       reverse conversion, taking the time in secs and returning the equivalent time in tp.

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

Name

pmtimespecNow,    pmtimespecInc,    pmtimespecDec,    pmtimespecAdd,   pmtimespecSub,   pmtimespecToReal,
       pmtimespecFromReal, pmPrintHighResStamp - helper routines for time stored as a struct timespec

Notes

       For variants of these interfaces  using  microsecond  precision  and  the  timeval  structure,  refer  to
       pmtimevalNow(3).

See Also

PMAPI(3), pmLocaltime(3) and pmtimevalNow(3).

Performance Co-Pilot                                   PCP                                      PMTIMESPECNOW(3)

See Also