Hi,
I need to time a certain function in my C/C++ code and I am experiencing some difficulties. I timed it using wallclock time so I know that it takes approximately 500-600 microseconds with
gettimeofday(&start, NULL);
// my function call
gettimeofday(&end, NULL);
answer = (end.tv_sec -... (2 Replies)
Hi,
I would like to display the exact time taken to complete running a particular tool or function or program to user
I don't know the exact time functions in unix, please help me
thanks in advance
Example:
$test.ksh
output should be
The... (10 Replies)
Hello
I have problem with function 'time' to test my program for file copying .
How to run the function in my source code ?
I try something like that:
system("time"); < -- but this don't working (2 Replies)
Hi All,
I am using solaris and nawk.
Is there any time function in nawk which is simliar to the shell `date` function ?
Can any experts show any examples? (4 Replies)
HI ,
I need to get the timedifference between two values... which funcation will help
eg: difference betweem 19:22 and 19:43 should give 21 mins (2 Replies)
HI
I have a Red Hat Enterprise with Real Time kernel.
Are you aware if there are C functions for this kernel or some code/library for this OS for measuring time more lightweight than clock_gettime and gettimeofday? THe hardware I have is NUMA.
Reading forums I found gethrtime but it is... (1 Reply)
Hello, I have made a Linux Shell Script that downloads 6 files from the Internet and then deletes them. Now i want to use the function "/usr/bin/time" and "bc" to calculate how long the avergate run time for the shell script is. I therefore need to do it 100 times. My shell script code is below:
... (6 Replies)
I want to print the difference (in days) between ($7) and the oldest record date ($6) based on unique ID ($5) on a new field. In addition, I want to subtract oldest date from recent dates(in days) ($6) for each unique ID ($5).
Here is the data looks like
7 81 1 47 32070 2010-12-14 ... (11 Replies)
Hi guys and gals...
I am writing a piece of code that is dash compliant and came across this error.
I have put it in the OSX section as that is what I am using.
I have no idea what the 'dash' version is but was installed about 6 months ago.
MBP, OSX 10.12.6, default terminal running dash on... (4 Replies)
Discussion started by: wisecracker
4 Replies
LEARN ABOUT OPENSOLARIS
gethrtime
gethrtime(9F) Kernel Functions for Drivers gethrtime(9F)NAME
gethrtime - get high resolution time
SYNOPSIS
#include <sys/time.h>
hrtime_t gethrtime(void);
DESCRIPTION
The gethrtime() function returns the current high-resolution real time. Time is expressed as nanoseconds since some arbitrary time in the
past; it is not correlated in any way to the time of day, and thus is not subject to resetting or drifting by way of adjtime(2) or settime-
ofday(3C). The hi-res timer is ideally suited to performance measurement tasks, where cheap, accurate interval timing is required.
RETURN VALUES
gethrtime() always returns the current high-resolution real time. There are no error conditions.
CONTEXT
There are no restrictions on the context from which gethrtime() can be called.
SEE ALSO proc(1), gettimeofday(3C), settimeofday(3C), attributes(5)NOTES
Although the units of hi-res time are always the same (nanoseconds), the actual resolution is hardware dependent. Hi-res time is guaranteed
to be monotonic (it does not go backward, it does not periodically wrap) and linear (it does not occasionally speed up or slow down for
adjustment, as the time of day can), but not necessarily unique: two sufficiently proximate calls might return the same value.
The time base used for this function is the same as that for gethrtime(3C). Values returned by both of these functions can be interleaved
for comparison purposes.
SunOS 5.11 2 Oct 2007 gethrtime(9F)