TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Bill Birrell
from: Jasen Betts
date: 2004-04-16 07:33:04
subject: Squares

Hi Bill.

14-Apr-04 16:51:00, Bill Birrell wrote to Darin McBride


 BB> Hi Darin,


 BB> Conceptually it is easy - just spawn or fork the program to be
 BB> timed, and do a clock() when it returns from the spawned program,
 BB> and Bob's your uncle - elapsed time in milliseconds (on this
 BB> machine) or whatever. As long as it is only comparing one with the
 BB> other, it is not necessary to demand perfect accuracy. Assume that
 BB> once compiled spawnl() will take roughly the same amount of time
 BB> for each instance

using times() would be more apropriate than clock() in environemnts that
support it. Also clock() doesn't count time spent in child processes in
some environments (like linux...)

 -=> Bye <=-

---
* Origin: Black Holes were created when God divided by zero! (3:640/1042)
SEEN-BY: 633/267 270
@PATH: 640/1042 531 954 774/605 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.