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

pmtimevalNow, pmtimevalInc, pmtimevalDec, pmtimevalAdd, pmtimevalSub, pmtimevalToReal, pmtimevalFromReal,

C Synopsis

#include<pcp/pmapi.h>voidpmtimevalNow(structtimeval*tv);voidpmtimevalInc(structtimeval*ap,conststructtimeval*bp);voidpmtimevalDec(structtimeval*ap,conststructtimeval*bp);doublepmtimevalAdd(conststructtimeval*ap,conststructtimeval*bp);doublepmtimevalSub(conststructtimeval*ap,conststructtimeval*bp);doublepmtimevalToReal(conststructtimeval*val);voidpmtimevalFromReal(doublesecs,structtimeval*val);voidpmPrintStamp(FILE*f,conststructtimeval*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.

       pmPrintStamp 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.

Name

pmtimevalNow, pmtimevalInc, pmtimevalDec, pmtimevalAdd, pmtimevalSub, pmtimevalToReal, pmtimevalFromReal,
       pmPrintStamp - helper routines for time stored as a struct timeval

Notes

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

See Also

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

Performance Co-Pilot                                   PCP                                       PMTIMEVALNOW(3)

See Also