Suggestion: use a profiler. Most UNIX systems compilers come with one.
You will get a display of how long your code spent in every function, plus the number of times it was called. The reason for the suggestion - it doesn't require instrumenting your code with timing calls.
hi guys..
i have a shell script that loops through a certain directory to see if a file has been created and then prints the file if it exists...
the only problem i have now is that sometimes the flat does not get created by the program thats supposed to create it, in this scenario, my loop... (1 Reply)
having problems using scp in that during peak hours it appears to time out.
anyone have similar experiences? any thoughts regarding a solution... (1 Reply)
I need to make it so an autmated process which involves ssh, times out if ssh prompts for a password. Most of the time it shouldnt prompt for a password. But if it does i need it to time it out or get a status and stop the ssh and log that the ssh failed and move onto the next server. Is there any... (9 Replies)
Hello everyone,
I have a script thats acting funky, what I would like to do is report to a file, how long its taking to get to certain area's, in seconds. For example.
-- Start timer
-- Run unix command 1
-- Run unix command 2
-- Stop timer
-- Report Seconds
-- etc etc
Is there a way... (3 Replies)
Hello there, I just needed to know how to get the timing right when using the gcc __builtin_prefetch() function, that is, how many instructions before the actual utilization of the data should I make the prefetch call.
I will be measuring the L1 cache hit rate with valgrind's cachegrind,... (3 Replies)
I was running some timings in my code to see which of several functions was the best and I've been getting some odd results. Here's the code I'm using:
static double time_loop(int (*foo)(int)) {
clock_t start, end;
int n = 0, i = 0;
start = clock();
for (; i <= MAXN; i++)
if... (6 Replies)
i have a very big script i have that i'd like to add a timeout to.
this script runs on a several remote host. i update this script with timeout clause and then copy it over to all the hosts on which it is currently on.
basically, i want the timeout to make the script abort/exit if it's... (1 Reply)
I have 7 functions those need to be executed as command line inputs, I tried with below code it’s not executing function. If I run the ./script 2 then fun2 should execute , how to initiate that function I tried case and if else also, how to initiate function from command line
if
then... (8 Replies)
-> We have 2 servers server1 and server2 server.
->server1 is master application and server2 is slave application server. ->output of server1 hardware and slave timing:
# hwclock --show Thu 05 Jun 2014 05:34:08 PM SGT -0.465666 seconds # date Thu Jun 5 17:34:16 SGT 2014
# cd... (6 Replies)
I have noticed the difference in byte swap timing between two Ubuntu systems. The bswap_32 used to work just fine on the old system, but on the new one it lags behind home-grown swap.
My code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <byteswap.h>
#include... (4 Replies)
Discussion started by: migurus
4 Replies
LEARN ABOUT ULTRIX
gettimeofday
gettimeofday(2) System Calls Manual gettimeofday(2)Name
gettimeofday, settimeofday - get or set date and time
Syntax
#include <sys/time.h>
gettimeofday(tp, tzp)
struct timeval *tp;
struct timezone *tzp;
settimeofday(tp, tzp)
struct timeval *tp;
struct timezone *tzp;
Description
The system call returns the system's notion of the current Greenwich time and the current time zone. Time returned is expressed relative
in seconds and microseconds since midnight January 1, 1970.
The structures pointed to by tp and tzp are defined in <sys/time.h> as:
struct timeval {
long tv_sec; /* seconds since Jan. 1, 1970 */
long tv_usec; /* and microseconds */
};
struct timezone {
int tz_minuteswest; /* of Greenwich */
int tz_dsttime; /* type of dst correction to apply */
};
The timezone structure indicates the local time zone (measured in minutes of time westward from Greenwich), and a flag that, if nonzero,
indicates that Daylight Saving time applies locally during the appropriate part of the year.
Only the superuser can set the time of day.
Return Values
A 0 return value indicates that the call succeeded. A -1 return value indicates an error occurred, and in this case an error code is
stored into the global variable errno.
Diagnostics
The call fails under the following conditions:
[EFAULT] An argument address referenced invalid memory.
[EPERM] A user other than the superuser attempted to set the time.
See Alsodate(1), stime(2), ctime(3)gettimeofday(2)