home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 348.lha / chatterbox_v1.0 / sources / setwait.c < prev    next >
C/C++ Source or Header  |  1990-02-14  |  657b  |  30 lines

  1. #include <exec/types.h>
  2. #include <functions.h>
  3. #include <devices/timer.h>
  4.  
  5. #define MATCH 0
  6.  
  7. extern int gab_interval;
  8. extern int minimum_timer_interval, maximum_timer_interval;
  9.  
  10. extern struct timerequest *tr;
  11.  
  12. void set_wait_seconds(timer_request,delay_seconds)
  13. struct timerequest *timer_request;
  14. long delay_seconds;
  15. {
  16.     timer_request->tr_node.io_Command = TR_ADDREQUEST;
  17.  
  18.     timer_request->tr_time.tv_secs = delay_seconds;
  19.     timer_request->tr_time.tv_micro = 0;
  20.  
  21.     SendIO(timer_request);
  22. }
  23.  
  24. determine_and_set_wait_seconds()
  25. {
  26.     gab_interval = minimum_timer_interval
  27.      + rando(maximum_timer_interval - minimum_timer_interval);
  28.     set_wait_seconds(tr,gab_interval);
  29. }
  30.