- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sleeping for fractions of a second
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-21-2002 12:08 AM
тАО06-21-2002 12:08 AM
We have a test harness that we control via ksh scripts. The load is applied by simply issuing the commnd "rcd_client" (our code) a number of times & then sleeping for a few a second (simple "sleep 1"). However, this method has been criticized as being too "bursty"...
Is there a way of sleeping for less than 1 second? (C, perl, ksh, anything really)
Tim
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-21-2002 12:13 AM
тАО06-21-2002 12:13 AM
Re: sleeping for fractions of a second
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x04bfa2db8513d6118ff40090279cd0f9,00.html
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-21-2002 12:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-21-2002 12:58 AM
тАО06-21-2002 12:58 AM
Re: sleeping for fractions of a second
---------
#include
main (int argc,char **argv)
{
usleep((int)argv[1]);
}
---------
Name this file usleep.c
Compile it like this: gcc -o usleep usleep.c
Make it an executable: chmod a+x usleep
Run it like: usleep 3
and it will let you sleep for 3 MILLISECONDS
Regards,
Ceesjan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-21-2002 01:24 AM
тАО06-21-2002 01:24 AM
Re: sleeping for fractions of a second
CeesJan, making a C program to just sleep 3 nanoseconds is complete non-snse :) You could as well just do return, given the fact that starting the process and ending it takes at least 3 nanoseconds, and also depends on the system load to return within the given time
in perl:
# usleep (seconds)
sub usleep ($)
{
select (undef, undef, undef, shift);
} # usleep
sleeping 10 microseconds would be
usleep (0.010);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-21-2002 01:25 AM
тАО06-21-2002 01:25 AM
Re: sleeping for fractions of a second
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-21-2002 02:12 AM
тАО06-21-2002 02:12 AM
Re: sleeping for fractions of a second
I think we could only sensibly sleep for 10 ms as "timeslice" is 10 (default)... But that is another question.
Many thanks for the replys, I will be doing all of them. 10pts a piece...
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-21-2002 02:53 AM
тАО06-21-2002 02:53 AM
Re: sleeping for fractions of a second
Perl wins.... I couldn't get the C programs to work. I'm less proficient in C than perl.
As said previously I only really need to sleep for up to 10ms, probably only 0.1s, so micro & nano second sleeps are too accurate... That said I'm sure with more than 2 minutes effort I could get the C stuff to work.
My loader will now be written in perl
Regards
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-21-2002 02:59 AM
тАО06-21-2002 02:59 AM