9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Sleep-complexity
@ 2005-05-08 12:03 Christoph Lohmann
  2005-05-08 12:51 ` Sergey Reva
  0 siblings, 1 reply; 26+ messages in thread
From: Christoph Lohmann @ 2005-05-08 12:03 UTC (permalink / raw)
  To: 9fans

Good day.

Just do be sure that there is no scientifc paper that describes the pro
of using for() in sleep(2), as an architecture decision:

% cat /n/sources/plan9/sys/src/cmd/sleep.c
#include <u.h>
#include <libc.h>

void
main(int argc, char *argv[])
{
	long secs;

	if(argc>1)
		for(secs = atol(argv[1]); secs > 0; secs--)
			sleep(1000);
	exits(0);
}

% cat /sys/src/cmd/sleep.c
#include <u.h>
#include <libc.h>

void
main(int argc, char *argv[])
{

	if(argc>1)
		sleep(atol(argv[1]) * 1000);

	exits(0);
}

% ls -l /386/bin/sleep /386/bin/_sleep
--rwxrwxr-x M 8 none sys 3409 May  8  13:43 /386/bin/_sleep
--rwxrwxr-x M 8 sys  sys 3390 Max  8  13:44 /386/bin/sleep

Is there any reason for the for()-loop?

Sincerely,

Christoph


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2005-05-10 21:20 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-08 12:03 [9fans] Sleep-complexity Christoph Lohmann
2005-05-08 12:51 ` Sergey Reva
2005-05-08 16:50   ` Russ Cox
2005-05-08 17:28     ` Dan Cross
2005-05-08 18:56       ` jmk
2005-05-08 19:21         ` Bruce Ellis
2005-05-08 20:54           ` Charles Forsyth
2005-05-08 21:06             ` Charles Forsyth
2005-05-08 22:40         ` Dan Cross
2005-05-08 22:59           ` geoff
2005-05-09  7:28             ` Richard Miller
2005-05-09 13:14             ` Brantley Coile
2005-05-09 16:45             ` Mike Haertel
2005-05-09 20:10               ` Bruce Ellis
2005-05-09 22:46                 ` Charles Forsyth
2005-05-09  7:41           ` David Tolpin
2005-05-08 21:12       ` Charles Forsyth
2005-05-09 13:29         ` Nigel Roles
2005-05-09 14:03           ` Charles Forsyth
2005-05-10 17:09         ` boyd, rounin
2005-05-10 17:15           ` jmk
2005-05-10 18:34             ` boyd, rounin
2005-05-10 18:39               ` rog
2005-05-10 19:27               ` Ronald G. Minnich
2005-05-10 21:02                 ` David Leimbach
2005-05-10 21:20                   ` Bruce Ellis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).