-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_ubuntu_perf_secondary.c
84 lines (76 loc) · 1016 Bytes
/
main_ubuntu_perf_secondary.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
do not care about this file, look at main_ubuntu_perf.care
*/
#include <unistd.h>
#include <string.h>
int main ( void ) {
int i = 0;
int j = 0;
char str[10];
/***********
** strcat **
***********/
/*
while (i < 10000000) {
j = 0;
str[0] = 0;
str[1] = 0;
str[2] = 0;
str[3] = 0;
str[4] = 0;
str[5] = 0;
str[6] = 0;
str[7] = 0;
str[8] = 0;
str[9] = 0;
while (j < 9) {
strcat(str, "a");
j++;
}
i++;
}
i = 0;
j = 0;
str[0] = 0;
str[1] = 0;
str[2] = 0;
str[3] = 0;
str[4] = 0;
str[5] = 0;
str[6] = 0;
str[7] = 0;
str[8] = 0;
str[9] = 0;
*/
/**********
** bzero **
**********/
j = 0;
i = j;
while (i < 100000000) {
str[0] = 123;
str[1] = 50;
str[2] = 12;
str[3] = 45;
str[4] = 85;
str[5] = 78;
str[6] = 20;
str[7] = 25;
str[8] = 45;
str[9] = 65;
bzero(str, 10);
i++;
}
i = j;
str[0] = 0;
str[1] = 0;
str[2] = 0;
str[3] = 0;
str[4] = 0;
str[5] = 0;
str[6] = 0;
str[7] = 0;
str[8] = 0;
str[9] = 0;
return (0);
}