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

pmParseInterval, pmParseHighResInterval - convert interval string to binary time structure

C Synopsis

#include<pcp/pmapi.h>intpmParseInterval(constchar*string,structtimeval*urslt,char**errmsg);intpmParseHighResInterval(constchar*string,structtimespec*nrslt,char**errmsg);cc...-lpcp

Description

pmParseInterval  parses  the  argument  string specifying an interval of time and fills in the tv_sec and
       tv_usec components of the urslt structure to represent that interval (microsecond precision).

       Similarly, pmParseHighResInterval parses the argument string and fills in the tv_sec and  tv_nsec  compo‐
       nents of the nrslt structure to represent that interval (nanosecond precision).

       The  input  string is most commonly the argument following a -t command line option to a PCP application,
       and the syntax is fully described in PCPIntro(1).

Diagnostics

pmParseInterval returns 0 and errmsg is undefined if the parsing is successful.

       If the given string does not conform to the required syntax pmParseInterval returns -1 and a  dynamically
       allocated  error  message  string in errmsg.  The error message is terminated with a newline and includes
       the text of the input string along with an indicator of the position at which  the  error  was  detected,
       e.g.
                 4minutes30mumble^--unexpectedvalue

       In the case of an error, the caller is responsible for calling free(3) to release the space allocated for
       errmsg.

Name

pmParseInterval, pmParseHighResInterval - convert interval string to binary time structure

See Also

PCPIntro(1), free(3), PMAPI(3) and pmParseTimeWindow(3).

Performance Co-Pilot                                   PCP                                    PMPARSEINTERVAL(3)

See Also