Sponsored Content
Full Discussion: POSIX compliance...
Operating Systems OS X (Apple) POSIX compliance... Post 302976999 by drl on Sunday 10th of July 2016 09:43:01 PM
Old 07-10-2016
Hi.

Also:
Code:
            For delays of finer granularity than one second, the Time::HiRes
            module (from CPAN, and starting from Perl 5.8 part of the standard
            distribution) provides usleep(). You may also use Perl's
            four-argument version of select() leaving the first three
            arguments undefined, or you might be able to use the "syscall"
            interface to access setitimer(2) if your system supports it. See
            perlfaq8 for details.

Excerpt from perldoc -f sleep

For example:
Code:
#!/usr/bin/env perl

# @(#) p1       Demonstrate usleep;

use Time::HiRes qw( usleep nanosleep );

$microseconds = 2500000;
usleep($microseconds);

# nanosleep ($nanoseconds);

exit(0);

which would produce something like:
Code:
time ./p1

real    0m2.514s
user    0m0.008s
sys     0m0.000s

On an older OS/X:
Code:
OS, ker|rel, machine: Apple/BSD, Darwin 9.8.0, Power Macintosh
Distribution        : Mac OS X 10.5.8 (leopard, workstation)
perl 5.8.8

real    0m2.578s
user    0m0.045s
sys     0m0.021s

Best wishes ... cheers, drl

Last edited by drl; 07-10-2016 at 11:02 PM..
This User Gave Thanks to drl For This Post:
 

5 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

sudo & Sox compliance

Hello, I am trying to convince my boss to stop allowing our users to login as root (superuser). Currently our users login to our unix server with their own account, then as needed, they will do an su and put in the root password. This scares me, for a bunch of reasons. Mainly, one is that we... (1 Reply)
Discussion started by: rwallaceisg
1 Replies

2. UNIX for Dummies Questions & Answers

man synopsis standard compliance

In different online sources, I found bits and pieces of information about those square and angular brackets and pipes. From what I have read, I can conclude it looks like this: 1. Options outside any brackets are mandatory 2. Options inside these < .. > are mandatory too 3. Options inside ... (4 Replies)
Discussion started by: vkleban
4 Replies

3. Cybersecurity

PCI DSS Compliance : Insecure Communication Has Been Detected

From the nessus scanner tool report i got below vulnerability PCI DSS Compliance : Insecure Communication Has Been Detected http://www.tenable.com/plugins/index.php?view=single&id=56208 As per the description given in above link - I am not able to understand How to find insecure port... (2 Replies)
Discussion started by: saurabh84g
2 Replies

4. Red Hat

Looking for PCI Compliance tool for Redhat Lix.

Hi i am in new to Linux world . I have been assigned to a project to find out a tool that will fulfill the PCI compliance for Linux servers for Audit process. anyone have any recommendation on that. Do Rad hat have any native application or plug-ins which we can use for that. (1 Reply)
Discussion started by: sahasuman
1 Replies

5. HP-UX

Password compliance setting

I need to set password compliance for some servers in my company. However, the requirements are that we need to set different password policies for 3 different user groups within the company. These are : System Users: i.e root, etc Batch/Application Users: oracle, bscs, etc Standard User:... (0 Replies)
Discussion started by: anaigini45
0 Replies
usleep(3)						     Library Functions Manual							 usleep(3)

NAME
usleep - Suspends execution for an interval of time LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <unistd.h> int usleep( useconds_t useconds); The following function declaration does not conform to current standards and is supported only for backward compatibility: #include <unistd.h> void usleep( unsigned useconds); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: usleep(): XPG4-UNIX Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Specifies the number of microseconds to sleep. DESCRIPTION
The usleep() function suspends the current process from execution for the number of microseconds specified by the useconds parameter. Because of other activity in the system, or because of the time spent in processing the call, the actual suspension time might be longer than specified. The useconds parameter must be less than 1,000,000. If the value of useconds is 0 (zero), the usleep() function has no effect. In a multithreaded environment, the sleep() function is redefined to suspend the calling thread. RETURN VALUES
On successful completion, the usleep() function returns 0 (zero). Otherwise, it returns -1 and sets errno to indicate the error. ERRORS
The usleep() function sets errno to the specified values for the following conditions: The interval specified in the useconds parameter exceeds 1,000,000 microseconds. RELATED INFORMATION
Functions: getitimer(2), sigaction(2), sigvec(2), alarm(3), sleep(3) Standards: standards(5) delim off usleep(3)
All times are GMT -4. The time now is 06:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy