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
Xacobeo::Timer(3pm)					User Contributed Perl Documentation				       Xacobeo::Timer(3pm)

NAME
Xacobeo::Timer - A custom made timer. SYNOPSIS
use Xacobeo::Timer; # As a one time use my $timer = Xacobeo::Timer->start("Long operation"); do_long_operation(); $timer->elapsed(); # Displays the time elapsed # A simple stop watch (the destructor displays the time elapsed) my $TIMER = Xacobeo::Timer->new("Method calls"); sub hotspot { $TIMER->start(); # Very slow stuff here $TIMER->stop(); } DESCRIPTION
This package provides a very simple timer. This timer is used for finding hot spots in the application. The timer is quite simple it provides the method "start" that starts the timer and the method "stop" that stops the timer and accumulates the elapsed time. The method "show" can be used to print the time elapsed so far while the method "elapsed" returns the time elapsed so far. When an instance of this class dies (because it was undefed or collected by the garbage collector) the builtin Perl desctrutor will automatically call the method "show". But if the method show or elapsed was called during the lifetime of the instance then the destructor will not invoke the method show. METHODS
The package defines the following methods: new Creates a new Timer. Parameters: o $name (Optional) The name of the timer. start Starts the timer. If this sub is called without a blessed instance then a new Timer will be created. Parameters: o $name (optional) The name is used only when called without a blessed instance. stop Stops the timer and adds accumulates the elapsed time. If the timer wasn't started previously this results in a no-op. show Prints the elapsed time. This method stops the timer if it was started previously and wasn't stopped. elapsed Returns the total time elapsed so far. If the timer was already started the pending time will not be taking into account. AUTHORS
Emmanuel Rodriguez <potyl@cpan.org>. COPYRIGHT AND LICENSE
Copyright (C) 2008,2009 by Emmanuel Rodriguez. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available. perl v5.14.2 2011-11-16 Xacobeo::Timer(3pm)
All times are GMT -4. The time now is 02:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy