2 Copyright © 2003-2013, The AROS Development Team. All rights reserved.
10 #include <exec/types.h>
11 #include <exec/memory.h>
12 #include <proto/exec.h>
16 struct timeval tv_start
,
23 gettimeofday(&tv_start
, NULL
);
25 for(i
= 0; i
< count
; i
++)
27 memory
= AllocVec(100, MEMF_ANY
);
31 gettimeofday(&tv_end
, NULL
);
33 elapsed
= ((double)(((tv_end
.tv_sec
* 1000000) + tv_end
.tv_usec
)
34 - ((tv_start
.tv_sec
* 1000000) + tv_start
.tv_usec
)))/1000000.;
38 "Elapsed time: %f seconds\n"
39 "Number of allocations: %d\n"
40 "Allocations per second: %f\n"
41 "Seconds per allocation: %f\n",
42 elapsed
, count
, (double) count
/ elapsed
, (double) elapsed
/ count