I have 2 files that print on the same line at the same time. I wanted to add time.sleep() to 1 of the textfiles. I wanted to delay the time that 1 textfile prints with the other 1 in this script. I wanted to have the files to create new lines instead of printing the same combinations when they both print. Where to add the time.sleep()?
Last edited by bigvito19; 09-04-2019 at 01:20 PM..
Neo,
can u please shorten the reply timer to like 1 min or so. It is prolly just me but i end up passing on replying to posts due to i hate waiting for my timer to reset w/ a 2.5 mins wait. (2 Replies)
anyone can help me how to implement the timer on AIX?
I tried with 'setitimer' and its related functions, but it does not work correctly,the program exited each time.
thanks (2 Replies)
Hi!,
My shell script takes a quite a long time to execute.. Nothing appears on the screen during this period.. User are left guessing... whats going on????????????
Any ideas on how to create a small timer script which print a word on screen say " wait.. Program running" after every 10 seconds... (3 Replies)
Hi all,
Wanted to a create a shell script
-----------------------------------------------------------------------
1) which when called will start a timer and wait for 48 hours.
after 48 hours it will call some function(say XYZ)
2) Whenever this shell script is called (can be called... (3 Replies)
Hello fellows,
I am new in this forum, i would appreciate your assistance.
I need a timming system for my vnc desktops (Cybercafe timer stuff).
Each unix user login to my server only with vnc, and i want to write a program that can generate timer tickets and have control on the time used for... (0 Replies)
Hello fellows,
I am new in this forum, i would appreciate your assistance.
I need a timming system for my vnc desktops (Cybercafe timer stuff).
Each unix user login to my server only with vnc, and i want to write a program that can generate timer tickets and have control on the time used for... (1 Reply)
hello all
since a process running in kernel mode cannnot be preempted by any other process what would be the status of Timer interrupt that occurs when the time quantum of a process is elapsed?
thanks (2 Replies)
How do you set timer as output to the command line so that you get an output like
Has been waiting for 5 seconds
Has been waiting for 6 seconds
...
Where only the number changes. (2 Replies)
Discussion started by: locoroco
2 Replies
LEARN ABOUT DEBIAN
sleepenh
SLEEPENH(1) General Commands Manual SLEEPENH(1)NAME
sleepenh - an enhanced sleep program.
SYNOPSIS
sleepenh [initial-time] sleep-time
DESCRIPTION
sleepenh is a program that can be used when there is a need to execute some functions periodically in a shell script. It was not designed
to be accurate for a single sleep, but to be accurate in a sequence of consecutive sleeps.
After a successful execution, it returns to stdout the timestamp it finished running, that can be used as initial-time to a successive exe-
cution of sleepenh.
OPTIONS
There are no command line options. Run it without any option to get a brief help and version.
ARGUMENTS
sleep-time is a real number in seconds, with microseconds resolution (1 minute, 20 seconds and 123456 microseconds would be 80.123456).
initial-time is a real number in seconds, with microseconds resolution. This number is system dependent. In GNU/Linux systems, it is the
number of seconds since midnight 1970-01-01 GMT. Do not try to get a good value of initial-time. Use the value supplied by a previous exe-
cution of sleepenh.
If you don't specify initial-time, it is assumed the current-time.
EXIT STATUS
An exit status greater or equal to 10 means failure. Known exit status:
0 Success.
1 Success. There was no need to sleep. (means that initial-time + sleep-time was greater than current-time).
10 Failure. Missing command line arguments.
11 Failure. Did not receive SIGALRM.
12 Failure. Argument is not a number.
13 Failure. System error, could not get current time.
USAGE EXAMPLE
Suppose you need to send the char 'A' to the serial port ttyS0 every 4 seconds. This will do that:
#!/bin/sh
TIMESTAMP=`sleepenh 0`
while true; do
# send the byte to ttyS0
echo -n "A" > /dev/ttyS0;
# just print a nice message on screen
echo -n "I sent 'A' to ttyS0, time now is ";
sleepenh 0;
# wait the required time
TIMESTAMP=`sleepenh $TIMESTAMP 4.0`;
done
HINT
This program can be used to get the current time. Just execute:
sleepenh 0
BUGS
It is not accurate for a single sleep. Short sleep-times will also not be accurate.
SEE ALSO date(1), sleep(1).
AUTHOR
This manual page was written by Pedro Zorzenon Neto.
2008/04/20 SLEEPENH(1)