03-23-2008
yes i know about it..
But the problem is i need to specify the exact amount of sec that it takes for the command to execute..
caclulating it will be difficult..
so its difficult to specify the exact time ,i need to use the sleep for..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all,
i need help. I want to write a script and insert a delay time of 10 seconds. Which is the command for do this?
Thanks in advance (1 Reply)
Discussion started by: christian
1 Replies
2. Shell Programming and Scripting
Hi Expert,
I need to run some command 5 times with 5 mins interval whenever one of the application on server hang.
Can I use below scripts ?
Thanks!
-------------
#!/bin/sh
command1
sleep 300
command2
sleep 300
command3
sleep 300
command4
sleep 300
command5
sleep 300... (2 Replies)
Discussion started by: skully
2 Replies
3. UNIX for Dummies Questions & Answers
Hello,
My name is John. I am from Spain and I am learning Linux and how to use it.
I hope to learn more in this forum.
I am developing a new application, and I have a doubt:
Can I read a file, line by line, in C programm?
Best regards. (1 Reply)
Discussion started by: webquinty
1 Replies
4. Shell Programming and Scripting
Hello,
My goal is to run the same Shell script in a parallel mode. This script will get triggered from different machines and different application teams by some job scheduling tool.
They may trigger the process at the same time. so I want to have them in QUEUE ..and release them for execution on... (3 Replies)
Discussion started by: chetan_sonar
3 Replies
5. Shell Programming and Scripting
Hi All,
How to introduce delay in the Bash/Shell Script till key stroke.
Below is the requirement..
1.Execute set of commands.
2.Display the message echo "press any key to continue"
Introduce a delay till key stroke.
3.Execute next set of commands.
Thanks in Advance
Sunil.K (5 Replies)
Discussion started by: sunilrk07
5 Replies
6. Shell Programming and Scripting
I need to put a small delay into a shell script. I'm looking for something smaller than "sleep" - a second is way too long. I want to sleep something like 10 milliseconds. I've tried "usleep" and "nanosleep", but the script doesn't recognize them.
I'm using the bash shell but I'm willing to... (9 Replies)
Discussion started by: harmlesscat
9 Replies
7. Solaris
Hello,
To learn ZFS, i try to create pool .
and for that i want create 10 files with 512MB (because i dont have multiple disks and multiple controllers)
ADMIT THAT THIS IS TEN HIGH-PERFORMANCE HARD DRIVES
To get this 10 files,all of them have the same size : 512MB,
I do these... (9 Replies)
Discussion started by: herbich1985
9 Replies
8. UNIX for Dummies Questions & Answers
I need to reformat a text using sed command like
Text: 160845
Output: 16:08:45
Please help me how this can be done using sed.
Thanks in adv (1 Reply)
Discussion started by: siteregsam
1 Replies
9. Shell Programming and Scripting
I am facing an issue where sometimes crontab is running script with some delay.
Below is the stmt in script and it is the only stmt in script.
echo "running at `date` " >> CRONCHECK.log
Below is the cron entry.
0 11 * * * CRONCHECK.sh
Below is the time of run each day.
running at Fri... (8 Replies)
Discussion started by: Nishant Singh
8 Replies
10. Shell Programming and Scripting
I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies
LEARN ABOUT DEBIAN
mojo::ioloop::delay
Mojo::IOLoop::Delay(3pm) User Contributed Perl Documentation Mojo::IOLoop::Delay(3pm)
NAME
Mojo::IOLoop::Delay - Synchronize events
SYNOPSIS
use Mojo::IOLoop::Delay;
# Synchronize multiple events
my $delay = Mojo::IOLoop::Delay->new;
$delay->on(finish => sub { say 'BOOM!' });
for my $i (1 .. 10) {
$delay->begin;
Mojo::IOLoop->timer($i => sub {
say 10 - $i;
$delay->end;
});
}
# Wait for events if necessary
$delay->wait unless Mojo::IOLoop->is_running;
DESCRIPTION
Mojo::IOLoop::Delay synchronizes events for Mojo::IOLoop.
EVENTS
Mojo::IOLoop::Delay can emit the following events.
"finish"
$delay->on(finish => sub {
my $delay = shift;
...
});
Emitted safely once the active event counter reaches zero.
ATTRIBUTES
Mojo::IOLoop::Delay implements the following attributes.
"ioloop"
my $ioloop = $delay->ioloop;
$delay = $delay->ioloop(Mojo::IOLoop->new);
Loop object to control, defaults to the global Mojo::IOLoop singleton.
METHODS
Mojo::IOLoop::Delay inherits all methods from Mojo::EventEmitter and implements the following new ones.
"begin"
my $cb = $delay->begin;
Increment active event counter, the returned callback can be used instead of "end".
my $delay = Mojo::IOLoop->delay;
Mojo::UserAgent->new->get('mojolicio.us' => $delay->begin);
my $tx = $delay->wait;
"end"
$delay->end;
$delay->end(@args);
Decrement active event counter.
"wait"
my @args = $delay->wait;
Start "ioloop" and stop it again once the "finish" event gets emitted, only works when "ioloop" is not running already.
# Use the "finish" event to synchronize portably
$delay->on(finish => sub {
my ($delay, @args) = @_;
...
});
$delay->wait unless $delay->ioloop->is_running;
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.2 2012-09-05 Mojo::IOLoop::Delay(3pm)