home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / programm / 5871 < prev    next >
Encoding:
Text File  |  1993-01-08  |  1.5 KB  |  50 lines

  1. Newsgroups: comp.unix.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!usc!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!tsp.med.umn.edu!jalegre
  3. From: jalegre@tsp.med.umn.edu (John Alegre)
  4. Subject: Trouble with setitimer and getitimer.
  5. Message-ID: <1993Jan8.215018.29800@news2.cis.umn.edu>
  6. Sender: news@news2.cis.umn.edu (Usenet News Administration)
  7. Nntp-Posting-Host: tsp.med.umn.edu
  8. Organization: University of Minnesota
  9. Date: Fri, 8 Jan 1993 21:50:18 GMT
  10. Lines: 38
  11.  
  12. I am trying to time a tight SCSI read loop on a 
  13. NeXT machine.
  14.  
  15. I am having trouble with the UNIX functions
  16. setitimer and getitimer.
  17.  
  18. My code (or one variation of it) looks like this:
  19.  
  20. struct itimerval    after;
  21.  
  22. setitimer(ITIMER_REAL, &after, 0L);
  23.     puts("Starting");
  24.     for(i=1;i<=num;i++)    
  25.         [self performSCSIRequest];
  26.     puts("Done");
  27. getitimer(ITIMER_REAL, &after);
  28.  
  29. I have not been able to get any kind of succesful
  30. data out of setitimer or getitimer.  If I do not
  31. assvalues to the various componets of after,
  32. I get back 0 or all fields.  If I do assaign
  33. initial values, I either get back the same values
  34. or garbage.
  35.  
  36. All comments welcome
  37. ---
  38. John N. Alegre
  39. Andante Systems
  40. VideoLabs Inc.
  41.  
  42. #############################################################
  43. # NeXTMail preferred.             |
  44. # jdev@andante.mn.org             |
  45. # alegrej@andante.mn.org          | If you plant ice,
  46. # jalegre@lenti.med.umn.edu       |  you're gonna harvest wind!
  47. # alegrej@libros.andante.mn.org   |    Hunter/Garcia      
  48. #############################################################
  49.  
  50.