Sponsored Content
Full Discussion: Proccess time
Special Forums Hardware Filesystems, Disks and Memory Proccess time Post 302278325 by pludi on Tuesday 20th of January 2009 02:54:57 AM
Old 01-20-2009
man 1 time
Code:
$ time ( perl -e 'for($i=0;$i<1000;$i++){}' )

real    0m0.004s
user    0m0.004s
sys     0m0.000s

 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to use 2 Proccess communicating with each other using 2 pipe

Hi, Guys ... I want to know how to use to 2 processes (A & B) communicating with each others through 2 pipes (Pipe1 & Pinpe2) : such that process A write to Pipe1 and Process B read from Pipe1 and process B write to Pipe2 and Process A read from Pipe2 . Does anyone have an idea about... (1 Reply)
Discussion started by: someone33
1 Replies

2. UNIX for Advanced & Expert Users

How To Provide Time Sync Using Nts-150 Time Server On Unix Network?

can anybody tel lme,how to instal NTS -150 on a unix network,it needs some patch to fetch time frm serve,,?? (2 Replies)
Discussion started by: pesty
2 Replies

3. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

4. Shell Programming and Scripting

Convert Epoch Time to Standard Date and Time & Vice Versa

Hi guys, I know that this topic has been discuss numerous times, and I have search the net and this forum for it. However, non able to address the problem I faced so far. I am on Solaris Platform and unable to install additional packages like the GNU date and gawk to make use of their... (5 Replies)
Discussion started by: DrivesMeCrazy
5 Replies

5. Shell Programming and Scripting

How to find out list of all proccess which are running on unix servers from last two days.

Hi All, I have a requirment, i need to get the list of all the process which are running from last two days on my unix server and also to put this list into an another file. i am giving you a sample example : $ ps -ef UID PID PPID C STIME TTY TIME CMD (1 Reply)
Discussion started by: akshu.agni
1 Replies

6. Shell Programming and Scripting

Running Shell Script in the cron, background proccess

Hi, i was looking for an answer for some trouble im having runing a script in the cron, thing is, that when i run it manually it works just fine. But when cron runs it, it just doenst work. I saw a reply on a similar subject, suggesting that the . .profile worked for you, but im kind of... (0 Replies)
Discussion started by: blacksteel1988
0 Replies

7. Solaris

modifying date and time and time zone on solaris 5.10 with (redundant server) veritas

I have a cluster of two Solaris server (veritas cluster). one working and the other is standby I am going to change the date on them , and am looking for a secure solution as it is giving an important service. my opinion is that the active one doesn't need to be restarted (if I don't change the... (1 Reply)
Discussion started by: barry1946
1 Replies

8. Shell Programming and Scripting

Convert UTC time into current UNIX sever time zone

Hi guys thanks for the help for my previous posts.Now i have a requirement that i download a XMl file which has UTC time stamp.I need to convert UTC time into Unix server timezone. For ex if the time zone of unix server is CDT then i need to convert into CDT.whatever may be the system time... (5 Replies)
Discussion started by: mohanalakshmi
5 Replies

9. Shell Programming and Scripting

Calculate Time diff in milli milliseconds(Time format : HH:MM:SS,NNN)

Hi All, I have one file which contains time for request and response. I want to calculate time difference in milliseconds for each line. This file can contain 10K lines. Sample file with 4 lines. for first line. Request Time: 15:23:45,255 Response Time: 15:23:45,258 Time diff... (6 Replies)
Discussion started by: Raza Ali
6 Replies
LOCKS(3)						   libbash locks Library Manual 						  LOCKS(3)

NAME
locks -- libbash library that implements locking (directory based). This library is not throughoutly tested - use with caution! SYNOPSIS
dirInitLock <object> [<spin>] dirTryLock <object> dirLock <object> dirUnlock <object> dirDestroyLock <object> DESCRIPTION
General locks is a collection of functions that implement locking (mutex like) in bash scripting language. The whole idea is based on the fact that directory creation/removal is an atomic process. The creation of this library was inspired by studying CVS locks management. Same lock object can by used by several processes to serialize access to some shared resource. (Well, yeah, this what locks were invented for...) To actually do this, processes just need to access lock object by the same name. Functions list: dirInitLock Initialize a lock object for your proccess dirTryLock Try to lock the lock object - give up if its already locked dirLock Lock the lock object - will block until object is unlocked dirUnlock Unlock the lock object dirDestroyLock Destroy the lock object - free resources Detailed interface description follows. FUNCTIONS DESCRIPTIONS
dirInitLock <object> [<spin>] Initialize a lock object for your process. Only after a lock is initialized, your proccess will be able to use it. Notice: This action does not lock the object. The lock can be set on two types of objects. The first is an existing directory. In this case, Aq dir must be a path (relative or full). The path must contain a '/'. The second is an abstract object used as a lock. In this case, the name of the lock will not contain any '/'. This can be used to create locks without creating real directories for them. Notice: Do not call your lock object '.lock'. Parameters: <object> The name of the lock object (either existing directory or abstract name) <spin> The time (in seconds) that the funtion dirLock will wait between two runs of dirTryLock. This parameter is optional, and its value gen- erally should be less then 1. If ommited, a default value (0.01) is set. Return Value: One of the following: 0 The action finished successfully. 1 The action failed. You do not have permissions to preform it. 3 The directory path could not be resolved. Possibly parameter does contain '/', but refers to directory that does not exist. dirTryLock <object> Try to lock the lock object. The function always returns immediately. Parameters: <object> The object that the lock is set on. Return Value: One of the following: 0 The action finished successfully. 1 The action failed. The object is already locked. 2 The action failed. Your proccess did not initialize a lock for the object. 3 The directory path could not be resolved. dirLock <object> Lock given lock object. If the object is already locked - the function will block untill the object is unlocked. After each try (dirTry- Lock) the function will sleep for spin seconds (spin is defined using dirInitLock ). Parameters: <object> The directory that the lock is set on. Return Value: One of the following: 0 The action finished successfully. 2 The action failed. Your proccess did not initialize a lock for the directory. 3 The directory path could not be resolved. dirUnlock <dir> Unlock the lock object. Parameters: <object> The object that the lock is set on. Return Value: One of the following: 0 The action finished successfully. 2 The action failed. Your proccess did not initialize the lock. 3 The directory path could not be resolved. dirDestroyLock <object> Destroys the lock object. After this action the proccess will no longer be able to use the lock object. To use the object after this action is done, one must initialize the lock, using dirInitLock. Parameters: <object> The directory that the lock is set on. Return Value: One of the following: 0 The action finished successfully. 1 The action failed. The directory is locked by your own proccess. Unlock it first. 2 The action failed. Your proccess did not initialize the lock. 3 The directory path could not be resolved. EXAMPLES
Creating an abstract lock named mylock, with 0.1 second spintime: $ dirInitLock mylock 0.1 # $?=0 Locking it: $ dirLock mylock # $?=0 Trying once to lock it again: $ dirTryLock mylock # $?=1 Trying to lock it again: $ dirLock mylock # Will wait forever Unlocking: $ dirUnlock mylock # $?=0 Destroying the lock: $ dirDestroyLock mylock # $?=0 Trying to lock again: $ dirLock mylock # $?=2 Creating a lock on the directory ./mydir, with default spin time: $ dirInitLock ./mydir # $?=0 AUTHORS
Hai Zaar <haizaar@haizaar.com> Gil Ran <gil@ran4.net> SEE ALSO
ldbash(1), libbash(1) Linux Epoch Linux
All times are GMT -4. The time now is 05:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy