home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!gatech!concert!samba!usenet
- From: Todd_Lewis@unc.edu (Todd M. Lewis)
- Subject: Re: Beginner 'C' Q about clock time
- Message-ID: <1992Sep15.192717.15753@samba.oit.unc.edu>
- Sender: usenet@samba.oit.unc.edu
- Nntp-Posting-Host: guitar.oit.unc.edu
- Organization: UNC Office of Information Technology
- References: <1992Sep14.130024.42975@kuhub.cc.ukans.edu>
- Date: Tue, 15 Sep 1992 19:27:17 GMT
- Lines: 16
-
- In article <1992Sep14.130024.42975@kuhub.cc.ukans.edu>
- 2ftqkiln@kuhub.cc.ukans.edu writes:
- >so could someone tell me how to get a [psudo-random] number
- >from the clock. Thanks in advance....-Dave
-
- ULONG seed;
- CurrentTime( &seed, &seed );
-
- This sets seed to some number that depends on how long the machine
- has been on, either the seconds or microseconds, but I don't really
- care which. This may be kindav ugly (and intuition.library had
- better be open) but it's so easy I can't help myself.
- --
- Todd M. Lewis / Todd_Lewis@unc.edu / utoddl@guitar.oit.unc.edu
- An acorn's destiny is not to become an oak tree.
- An acorn's destiny is to become a squirrel.
-