YD14@BR1.THDNET (11/04/85)
What's the difference between vax/vms cpu time values
and random number ?
I tested the following program five times on our 780.
I got the values 1.71, 1.47, 1.84, 1.43, and 1.59 seconds as
cpu time usage.
.title TEST
TIMER: .LONG
TIME: .ASCID /0 0:0:0.01/
SEC1: .BLKB 8
.entry mac,M<R2,R3>
pushal timer
calls #1,gLIB$INIT_TIMER
$BINTIM_S TIMBUF=TIME,TIMADR=SEC1
$SCHDWK_S REPTIM=SEC1,DAYTIM=SEC1
movl #1000,r3
20$: movl #8000,r2
10$: decl R2
bneq 10$
$HIBER_S
decl R3
bneq 20$
$CANWAK_S
pushal timer
calls #1,gLIB$SHOW_TIMER
movl #1,R0
ret
.end mac
If I delete the system service calls $SCHDWK_S, $HIBER_S,
and $CANWAK_S from the programm the VAX has to execute less
instructions. But the results are strange now I've got
8.21, 8.18, 8.16, 8.21 and 8.12 seconds cpu time usage.
What's that, 8 seconds instead of 2 ?
So I think the cpu time is a random number.
Note: The constant of the instruction at label 20$ depends on the
cpu type and probably on some SYSGEN parameter. For a 750
you should use a value less than 8000 f.e. 4000.
20$: movl #8000,r2
Reinhard Goeth
Technical University of Darmstadt (Fed. Rep. of Germany)
Networkaddress: #D14@DDATHD21.BITNET
#D14%DDATHD21.BITNET@WISCVM.ARPA
#D14%DDATHD21.BITNET@WISCVM.WISC.EDU