pmm
1.0.0
Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
test
timer_test.c
Go to the documentation of this file.
1
#include <math.h>
2
#include <stdlib.h>
3
#include <stdio.h>
4
#include "
pmm_util.h
"
5
6
#define NARGS 1
7
8
int
main
(
int
argc,
char
**argv) {
9
10
11
/* declare variables */
12
double
a;
13
double
b;
14
double
c;
15
double
i;
16
17
/* parse arguments */
18
if
(argc !=
NARGS
+1) {
19
return
PMM_EXIT_ARGFAIL
;
20
}
21
if
(sscanf(argv[1],
"%lf"
, &i) == 0) {
22
return
PMM_EXIT_ARGPARSEFAIL
;
23
}
24
25
printf(
"%f\n"
, i);
26
27
/* initialise data */
28
a = M_PI;
29
b = M_E;
30
31
/* initialise timer */
32
pmm_timer_init
();
33
34
/* start timer */
35
pmm_timer_start
();
36
37
/* execute routine */
38
while
(i>0.0) {
39
c = a * b;
40
i = i - 1.0;
41
}
42
43
/* stop timer */
44
pmm_timer_stop
();
45
46
/* get timing result */
47
pmm_timer_result
();
48
49
/* destroy timer */
50
pmm_timer_destroy
();
51
52
return
PMM_EXIT_SUCCESS
;
53
}
Generated on Fri Apr 5 2013 18:25:33 for pmm by
1.8.1.2