🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
2 messages
2 total messages Started by John Alegre Fri, 08 Jan 1993 21:52
Trouble with setitimer and getitimer.
#2249
Author: John Alegre
Date: Fri, 08 Jan 1993 21:52
37 lines
1626 bytes
I am trying to time a tight SCSI read loop on a 
NeXT machine.

I am having trouble with the UNIX functions
setitimer and getitimer.

My code (or one variation of it) looks like this:

struct itimerval	after;

setitimer(ITIMER_REAL, &after, 0L);
	puts("Starting");
	for(i=1;i<=num;i++)    
		[self performSCSIRequest];
	puts("Done");
getitimer(ITIMER_REAL, &after);

I have not been able to get any kind of succesful
data out of setitimer or getitimer.  If I do not
assvalues to the various componets of after,
I get back 0 or all fields.  If I do assaign
initial values, I either get back the same values
or garbage.

All comments welcome
---
John N. Alegre
Andante Systems
VideoLabs Inc.

#############################################################
# NeXTMail preferred.             |
# jdev@andante.mn.org             |
# alegrej@andante.mn.org          | If you plant ice,
# jalegre@lenti.med.umn.edu       |  you're gonna harvest wind!
# alegrej@libros.andante.mn.org   |    Hunter/Garcia      
#############################################################
Re: Trouble with setitimer and getitimer.
#2296
Author: Louis A. Mamakos
Date: Mon, 11 Jan 1993 15:29
13 lines
998 bytes
In article <1993Jan8.215238.29927@news2.cis.umn.edu> jalegre@tsp.med.umn.edu (John Alegre) writes:
>I am trying to time a tight SCSI read loop on a 
>NeXT machine.
>
>I am having trouble with the UNIX functions
>setitimer and getitimer.

You don't want to use setitimer or getitimer, which are used to generate
alarm clock signals to your process.  What you really want to use is
gettimeofday() before and after.  Do 'man 2 gettimeofday' and also look
at <sys/timer.h>

Louis Mamakos
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads