09-12-2001
If it's something you are running manually, or from a script, you can simply use the time command! For example:
time sleep 2
real 0m2.009s
user 0m0.000s
sys 0m0.000s
So, in actuality, It took a total of 2.009 seconds of my time to watch this command complete. But, as you can see, it used virtually no processing time.
10 More Discussions You Might Find Interesting
1. Programming
Hi all,
I like to know how can I get currenlty running process start time and date , I know only porcess id in solaris and hp-ux
and
what is command to get same using ps with switch.
Thanks
Naeem (1 Reply)
Discussion started by: naeem ahmad
1 Replies
2. Solaris
Hi there
I have a backup script that runs every night and for some reason ive been getting in in the morning and the process has died, Is there any way I can tell when it died? if not .....would anybody recommend some scripting that i could do that would be able to tell me this information
... (3 Replies)
Discussion started by: hcclnoodles
3 Replies
3. Programming
Hi,
I have a program where I fork few child jobs and call execvp to run another jobs. I use wait to wait for any job to get complete.
Requirement is I need to know the actual time taken by child job during execution.
I thought of calculating the time just before forking and after wait, but... (3 Replies)
Discussion started by: anjul_thegreat
3 Replies
4. UNIX for Dummies Questions & Answers
how to decrease priority of a particular process in time of process creation...
and also how to decrease priority of a particular process after process creation..
can any one please help me out... (2 Replies)
Discussion started by: Ramkum
2 Replies
5. Shell Programming and Scripting
Guys,
I've written the following to proces one line at a time and then process individual column within the line.. But it works only when there is one line. I know awk will simply fetch multiple lines when run against a file with many lines. How do i achieve this ?
cat ${PARFILE} |... (3 Replies)
Discussion started by: kamathg
3 Replies
6. UNIX for Advanced & Expert Users
Hi All,
I am running the following accounting on one of my executable,
$ accton /home/myexe-acct
$ ./myexe
$ accton
When I check the process timings I get the below result,
Shell process time: 300ms
myexe time: 100ms
I want to know on why the shell(sh) process is taking so much time... (1 Reply)
Discussion started by: santoshbr4
1 Replies
7. Linux
Process start time is not showing the correct time:
I had started a process on Jun 17th at 23:30:00.
Next day morning when I run the command "ps -ef | grep mq", the process is showing the start date of Jun 17th but the start time is 00:16:41
Day/Date is setup correctly on the server.
It... (2 Replies)
Discussion started by: hemangjani
2 Replies
8. UNIX for Dummies Questions & Answers
Hi, I'm trying to learn csh so I've started to do some simple scrips.
Now I'm kinda stuck in this one: I want to do a script that first search, for each user, if there's at least a process with a TIME >= something (30 mins, for example).
There are 2 things that I cant figure out:
- in the... (3 Replies)
Discussion started by: GarFunkel
3 Replies
9. Shell Programming and Scripting
Hello All,
I have a problem calculating the time difference between start and end timings...!
the timings are given by 24hr format..
Start Date : 08/05/10 12:55
End Date : 08/09/10 06:50
above values are in mm/dd/yy hh:mm format.
Now the thing is, 7th(08/07/10) and... (16 Replies)
Discussion started by: smarty86
16 Replies
10. Solaris
We are using JAVA program and strange thing is it takes 100% CPU when not in use.
The program function is to stream a file on output port (one direction). It checks one directory and when there is a file in it, starts.
While it is streaming the CPU usage is normal, about 20%.
But, if... (9 Replies)
Discussion started by: orange47
9 Replies
SLEEP(1) BSD General Commands Manual SLEEP(1)
NAME
sleep -- suspend execution for an interval of time
SYNOPSIS
sleep seconds
DESCRIPTION
The sleep utility suspends execution for a minimum of seconds. It is usually used to schedule the execution of other commands (see EXAMPLES
below).
Note: The NetBSD sleep command will accept and honor a non-integer number of specified seconds. This is a non-portable extension, and its
use will nearly guarantee that a shell script will not execute properly on another system.
When the SIGINFO signal is received, the estimate of the amount of seconds left to sleep is printed on the standard output.
EXIT STATUS
The sleep utility exits with one of the following values:
0 On successful completion, or if the signal SIGALRM was received.
>0 An error occurred.
EXAMPLES
To schedule the execution of a command for 1800 seconds later:
(sleep 1800; sh command_file >& errors)&
This incantation would wait half an hour before running the script command_file. (See the at(1) utility.)
To reiteratively run a command (with csh(1)):
while (1)
if (! -r zzz.rawdata) then
sleep 300
else
foreach i (*.rawdata)
sleep 70
awk -f collapse_data $i >> results
end
break
endif
end
The scenario for a script such as this might be: a program currently running is taking longer than expected to process a series of files, and
it would be nice to have another program start processing the files created by the first program as soon as it is finished (when zzz.rawdata
is created). The script checks every five minutes for the file zzz.rawdata, when the file is found, then another portion processing is done
courteously by sleeping for 70 seconds in between each awk job.
SEE ALSO
at(1), nanosleep(2), sleep(3)
STANDARDS
The sleep command is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible.
BSD
August 13, 2011 BSD