10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
AFILENAME=glow.sh
FILENAME="/${AFILENAME}"
WIDTHA=$(echo ${FILENAME} | wc -c)
NTIME=0
RESULTS=$(for eachletter in $(echo ${FILENAME} | fold -w 1)
do
WIDTHTIMES=$(awk "BEGIN{printf... (5 Replies)
Discussion started by: SkySmart
5 Replies
2. Shell Programming and Scripting
i am using bash
START=$(date +%s)
END=$(date +%s)
DIFF=$(echo "$END - $START" )
this code is not working (14 Replies)
Discussion started by: rafa_fed2
14 Replies
3. UNIX for Dummies Questions & Answers
how much time a particular command or shell script executed
there is any command to know this
thanks (5 Replies)
Discussion started by: tsurendra
5 Replies
4. Shell Programming and Scripting
Hello,
I'm running a bash script and I'd like to get more accurate a runtime information then now.
So far I've been using this method:
STARTM=`date -u "+%s"`
.........
*script function....
.........
STOPM=`date -u "+%s"`
RUNTIMEM=`expr $STOPM - $STARTM`
if (($RUNTIMEM>59)); then... (6 Replies)
Discussion started by: TehOne
6 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
Can we get to know the start time and end time of execution of a script? (This script doesn't write any logs.) I mean, is there any built in process logs to track these records? (2 Replies)
Discussion started by: siba.s.nayak
2 Replies
6. Shell Programming and Scripting
Hi,
I have a simple question. How can I get the execution time of a script and maybe put it in a variable?
Another question. How can I get only time and not date and put it in a variable? I tried something with "date" command but with no success...
If someone could help me... (8 Replies)
Discussion started by: Moumou
8 Replies
7. Shell Programming and Scripting
i want to test whether a script has been executed in last 15 days or not....please help how can i do this...is there any copmmand there to know timings of last execution of any script (8 Replies)
Discussion started by: arghya_owen
8 Replies
8. Shell Programming and Scripting
I am writting a script in the ksh shell and am trying to find a way to report the total execution time of the script without requiring the user to specify the time function when executing the script.
Does anyone have any examples they have used. I have been setting up two date variables (one at... (9 Replies)
Discussion started by: johnsonbryce
9 Replies
9. UNIX for Dummies Questions & Answers
is there a command in Solaris 8 that will show a particular scripts last execution time? (1 Reply)
Discussion started by: cubs0729
1 Replies
10. Programming
hi ,
i ve coded a C program
in that im using malloc dynamically ,
it is being called many times in the program
The program is to simulate jobs in manufacturing system.
the execution time is increasing drastically as the number of jobs are increased.
could any body tel what may be the problem... (2 Replies)
Discussion started by: ramki_rk
2 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)