EnglishFrenchSpanish

OnWorks favicon

sleepenh - Online in the Cloud

Run sleepenh in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command sleepenh that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


sleepenh - an enhanced sleep program

SYNOPSIS


sleepenh [[--warp|-w] INITIALTIME] TIMETOSLEEP

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 INITIALTIME to a successive execution of sleepenh.

OPTIONS


-h, --help
display this help and exit

-w, --warp
warp resulting timestamp, when there is no need to sleep. An immediatly following
call of sleepenh with the resulting TIMESTAMP would most probably result in a real
sleep.

-V, --version
output version information and exit

ARGUMENTS


TIMETOSLEEP is a real number in seconds, with microseconds resolution (1 minute, 20
seconds and 123456 microseconds would be 80.123456).
INITIALTIME 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 INITIALTIME. Use the value supplied by a
previous execution of sleepenh.
If you don't specify INITIALTIME, 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 INITIALTIME + TIMETOSLEEP 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

Use sleepenh online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    strace
    strace
    The strace project has been moved to
    https://strace.io. strace is a
    diagnostic, debugging and instructional
    userspace tracer for Linux. It is used
    to monitor a...
    Download strace
  • 2
    gMKVExtractGUI
    gMKVExtractGUI
    A GUI for mkvextract utility (part of
    MKVToolNix) which incorporates most (if
    not all) functionality of mkvextract and
    mkvinfo utilities. Written in C#NET 4.0,...
    Download gMKVExtractGUI
  • 3
    JasperReports Library
    JasperReports Library
    JasperReports Library is the
    world's most popular open source
    business intelligence and reporting
    engine. It is entirely written in Java
    and it is able to ...
    Download JasperReports Library
  • 4
    Frappe Books
    Frappe Books
    Frappe Books is a free and open source
    desktop book-keeping software that's
    simple and well-designed to be used by
    small businesses and freelancers. It'...
    Download Frappe Books
  • 5
    Numerical Python
    Numerical Python
    NEWS: NumPy 1.11.2 is the last release
    that will be made on sourceforge. Wheels
    for Windows, Mac, and Linux as well as
    archived source distributions can be fou...
    Download Numerical Python
  • 6
    CMU Sphinx
    CMU Sphinx
    CMUSphinx is a speaker-independent large
    vocabulary continuous speech recognizer
    released under BSD style license. It is
    also a collection of open source tools ...
    Download CMU Sphinx
  • More »

Linux commands

crm
crm
Use crm online using onworks.net
services. ...
Run crm
  • 4
    crmgr
    crmgr
    crmgr - administration utility for QDBM
    Curia ...
    Run crmgr
  • 5
    gappletviewer
    gappletviewer
    gappletviewer - Load and runs an applet
    ...
    Run gappletviewer
  • 6
    gaps
    gaps
    mummer - package for sequence alignment
    of multiple genomes ...
    Run gaps
  • s-processed="true">
    g15stats
    g15stats - A CPU/Memory/Swap usage
    meter for G15Daemon DESCRIPTION: The
    packages provides the following usage
    meter for LCD on some Logitech
    keyboards, usind g...
    Run g15stats
  • More »
  • Ad