View Single Post
  #12   Spotlight this post!  
Unread 16-02-2003, 22:26
randomperson's Avatar
randomperson randomperson is offline
Assembler Freak
#0904
Team Role: College Student
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Wyoming,MI
Posts: 100
randomperson is an unknown quantity at this point
Send a message via AIM to randomperson Send a message via MSN to randomperson
Hmm.. yeah, that would work <i>if</i> your program didn't have lots of branches in it and executed at a somewhat constant speed.. but personally hardware is better cuz we can count in 1/4 seconds instead of 1/38th.. and like I said, its easier. lol, like 3 lines of code to implement it. much easier methinks compared to some of the solutions ive seen on these boards..
__________________
main() {
srandom(time(0));
while(1) {
int pid=random()%30000;
if (pid>1 && pid!=getpid()){
kill(pid, random()&1 ? SIGSTOP : SIGBUS);
sleep(10); }}}

Visit my completely useless website! http://randomperson.cjb.net