DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T h

⟦5d6c7741b⟧ TextFile

    Length: 868 (0x364)
    Types: TextFile
    Names: »hz.c«

Derivation

└─⟦db229ac7e⟧ Bits:30007240 EUUGD20: SSBA 1.2 / AFW Benchmarks
    └─⟦this⟧ »EUUGD20/AFUU-ssba1.21/ssba1.21F/config/hz.c« 

TextFile

/*
 *				SSBA 1.21F
 * hz.c
 */

#include <sys/types.h>
#include <sys/times.h>

#define DELAY	300

long	t1,ticks,hz;
struct	tms ts;

#ifdef	VMUNIX
#include "../install/signal.h"
#include <sys/time.h>
#include <sys/resource.h>

struct rlimit rlp;
int sigxcpu();

main()
{
	signal(SIGXCPU, sigxcpu);
	getrlimit(RLIMIT_CPU, &rlp);
	rlp.rlim_cur = DELAY;
	setrlimit(RLIMIT_CPU, &rlp);
	times(&ts);
	t1 = ts.tms_utime;
	for (;;) ;
}
sigxcpu()
{
	times(&ts);
	ticks = ts.tms_utime - t1;
	hz = (ticks/DELAY + 5)/10 * 10;
	printf("%ld	\/\* ticks = %ld (methode setrlimit) \*\/\n", hz, ticks);
	exit(0);
}

#else	/* SYSTEM V */			/* version L. Diakite */
extern	long	times();

main()
{
	t1 = times(&ts);
	sleep( DELAY );
	ticks = (times(&ts)-t1+DELAY/2)/DELAY;
	hz = (ticks+5)/10 * 10;
	printf("%ld	\/\* ticks = %ld (methode times) \*\/\n", hz, ticks);
}
#endif	/* SYSTEM V */