gethrtime man page on HP-UX

Man page or keyword search:  
man Server   10987 pages
apropos Keyword Search (all sections)
Output format
HP-UX logo
[printable version]

gethrtime(3C)							 gethrtime(3C)

NAME
       gethrtime() - get high resolution time

SYNOPSIS
DESCRIPTION
       The  function  returns  the current high-resolution real time.  Time is
       expressed as nanoseconds since a certain time in the  past.   This  API
       uses a fast light weight system call to get the nanoseconds from a cer‐
       tain time.  It is not correlated in any way to the time	of  day.  This
       API is used for performance measurement tasks and is used for cheap and
       accurate interval timing.

       is a signed 64-bit number.

RETURN VALUE
       Upon successful completion, returns a number  of	 nanoseconds.	Other‐
       wise, a value of -1 is returned.

WARNINGS
       This API will only be available if the application is being compiled in
       -Ae mode (extended ANSI) because 64-bit integer numbers are not	avail‐
       able in -Aa (ANSI) mode. Please refer to cc(1).

       When  the  time returned from is obtained in each of the two threads of
       execution, a comparison of the two return values may give  the  appear‐
       ance  that  time	 is  different across each of the threads and may even
       appear to be going backwards.

EXAMPLES
       The following code fragment measures the average cost of

	    hrtime_t begin, end;

	    int i, count = 1000;

	    begin = gethrtime();

	    for (i = 0; i < count; i++)

		    getgid();

	    end = gethrtime();

	    printf("Avg getgid() time = %lld nsec", (end - begin)/count );

								 gethrtime(3C)
[top]

List of man pages available for HP-UX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net