Sponsored Content
Full Discussion: How to get system time
Top Forums Shell Programming and Scripting How to get system time Post 302426282 by akabir77 on Tuesday 1st of June 2010 09:40:26 AM
Old 06-01-2010
How to get system time

I am trying to write a script which will compare the start time of a process with the current time. but I am having trouble finding the command to get the current time.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Monitoring system available time

Hi, I am new to Unix. I have an application which i need to monitor it for the available system time. If the system is down, i need to send an email notifying the downtime. Can someone provide a sample code or shell script to perform the above activity. Thanks (3 Replies)
Discussion started by: borncrazy
3 Replies

2. Programming

getting the system time with ms percision

I would like to get the system time down to the milli second. Is there any way to do this. clock_gettime only gives you the time to the nearest second. How can I get it down to the nearest milli second? THanks (1 Reply)
Discussion started by: dmirza
1 Replies

3. UNIX for Dummies Questions & Answers

System Startup Time

Hi all, Can anyone tell me how to find the System Startup time. Currently I am using "who -b" to get last reboot time. I wanted to know is there any log file for SCO Openserver 5, in which all this sort of imformations are kept. I have tried searching the forum with words like "WHO... (6 Replies)
Discussion started by: shoeb_syed
6 Replies

4. Shell Programming and Scripting

System time

Hey all, I need to write a script which will invoke another script everything 5 minutes until certain time is reached (say 4:00 pm). Can anyone give me some pointers please? Thanks! (1 Reply)
Discussion started by: mpang_
1 Replies

5. Shell Programming and Scripting

System time comparison to fixed defined time

I have a requirement of checking the current system time and performing certain actions in a shell script. example: if the current system time is greater than 1400 hrs, then perform step 1,2,3 if the current system time is greater than 1000 hrs, then perform step 1,2 if the current system time... (2 Replies)
Discussion started by: zainravi
2 Replies

6. Solaris

getting time independent of system time in solaries

i am using function gethrtime() in sun solaries to get the time independent of the system time.Problem with this function is if we restart the system time will change to '0'.is there any other way to resolve this problem. thanks & regards suresh (3 Replies)
Discussion started by: suresh_rtp
3 Replies

7. Solaris

System time and Cron time stamp not matching

On Solaris 10 server the system date won't match with the timestamp on files created by a cron jobs, Please help here is what i get when i check for system date infodba-ie10ux014:/tcpdv1_ie10/tcadmin/bin\n\r-> date Tue Apr 24 15:27:43 GMT 2012at same time i executed a cron job, and checked... (4 Replies)
Discussion started by: karghum
4 Replies

8. Shell Programming and Scripting

what would a script include to find CPU's %system time high and user time high?

Hi , I am trying to :wall: my head while scripting ..I am really new to this stuff , never did it before :( . how to find cpu's system high time and user time high in a script?? thanks , help would be appreciated ! :) (9 Replies)
Discussion started by: sushwey
9 Replies

9. Shell Programming and Scripting

Additional time to system time

Hi All, Is there any command to add additional time to date command. I need to add 5 hours to the present system time. I am getting the time by using date command. WORKFLOW_START_TIME=`date +%m/%d/%Y\ %H:%M:%S` Thanks (8 Replies)
Discussion started by: nag_sathi
8 Replies

10. Linux

Time: Hwclock and System Time

Hey everyone. Upon studying linux trying to learn it inside and out, I'm reading about the issue of time. Hardware clock time vs the more commonly referenced System Time. What causes the two to grow apart, and what causes the time itself to stray away from UTC? at present my clock is a second and... (1 Reply)
Discussion started by: Lost in Cyberia
1 Replies
after(n)						       Tcl Built-In Commands							  after(n)

__________________________________________________________________________________________________________________________________________________

NAME
after - Execute a command after a time delay SYNOPSIS
after ms after ms ?script script script ...? after cancel id after cancel script script script ... after idle ?script script script ...? after info ?id? _________________________________________________________________ DESCRIPTION
This command is used to delay execution of the program or to execute a command in background sometime in the future. It has several forms, depending on the first argument to the command: after ms Ms must be an integer giving a time in milliseconds. The command sleeps for ms milliseconds and then returns. While the command is sleeping the application does not respond to events. after ms ?script script script ...? In this form the command returns immediately, but it arranges for a Tcl command to be executed ms milliseconds later as an event handler. The command will be executed exactly once, at the given time. The delayed command is formed by concatenating all the script arguments in the same fashion as the concat command. The command will be executed at global level (outside the context of any Tcl procedure). If an error occurs while executing the delayed command then the bgerror mechanism is used to report the error. The after command returns an identifier that can be used to cancel the delayed command using after cancel. after cancel id Cancels the execution of a delayed command that was previously scheduled. Id indicates which command should be canceled; it must have been the return value from a previous after command. If the command given by id has already been executed then the after can- cel command has no effect. after cancel script script ... This command also cancels the execution of a delayed command. The script arguments are concatenated together with space separators (just as in the concat command). If there is a pending command that matches the string, it is cancelled and will never be executed; if no such command is currently pending then the after cancel command has no effect. after idle script ?script script ...? Concatenates the script arguments together with space separators (just as in the concat command), and arranges for the resulting script to be evaluated later as an idle callback. The script will be run exactly once, the next time the event loop is entered and there are no events to process. The command returns an identifier that can be used to cancel the delayed command using after can- cel. If an error occurs while executing the script then the bgerror mechanism is used to report the error. after info ?id? This command returns information about existing event handlers. If no id argument is supplied, the command returns a list of the identifiers for all existing event handlers created by the after command for this interpreter. If id is supplied, it specifies an existing handler; id must have been the return value from some previous call to after and it must not have triggered yet or been cancelled. In this case the command returns a list with two elements. The first element of the list is the script associated with id, and the second element is either idle or timer to indicate what kind of event handler it is. The after ms and after idle forms of the command assume that the application is event driven: the delayed commands will not be executed unless the application enters the event loop. In applications that are not normally event-driven, such as tclsh, the event loop can be entered with the vwait and update commands. SEE ALSO
bgerror(n), concat(n), update(n), vwait(n) KEYWORDS
cancel, delay, idle callback, sleep, time Tcl 7.5 after(n)
All times are GMT -4. The time now is 05:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy