|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T h
Length: 868 (0x364)
Types: TextFile
Names: »hz.c«
└─⟦db229ac7e⟧ Bits:30007240 EUUGD20: SSBA 1.2 / AFW Benchmarks
└─⟦this⟧ »EUUGD20/AFUU-ssba1.21/ssba1.21F/config/hz.c«
/*
* 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 */