comparison profile.c @ 7:972a7f233b23

g++ compile
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 07 Dec 2010 23:03:45 +0900
parents 01387a2e419e
children
comparison
equal deleted inserted replaced
6:6541f0bebb81 7:972a7f233b23
38 t->average = etime; 38 t->average = etime;
39 } 39 }
40 return etime; 40 return etime;
41 } 41 }
42 42
43 void timeprof_sprint(char *s, char *profname, Timeprof t) 43 void timeprof_sprint(char *s, const char *profname, Timeprof t)
44 { 44 {
45 sprintf(s, "%s: average:%dusec, peak:%dusec", profname, t->average, 45 sprintf(s, "%s: average:%dusec, peak:%dusec", profname, t->average,
46 t->peak); 46 t->peak);
47 } 47 }
48 48
53 timeprof_overhead = timeprof_end(&t); 53 timeprof_overhead = timeprof_end(&t);
54 } 54 }
55 55
56 Timeprof timeprof_new() 56 Timeprof timeprof_new()
57 { 57 {
58 Timeprof t = malloc(sizeof(struct time_profile)); 58 Timeprof t = (Timeprof) malloc(sizeof(struct time_profile));
59 memset(t, 0, sizeof(struct time_profile)); 59 memset(t, 0, sizeof(struct time_profile));
60 return t; 60 return t;
61 } 61 }