home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / amiga / programm / 13396 < prev    next >
Encoding:
Text File  |  1992-09-15  |  1.1 KB  |  29 lines

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