OLD | NEW |
| (Empty) |
1 #include <stdio.h> | |
2 #include <time.h> | |
3 #include <string> | |
4 #include <sys/time.h> | |
5 #include <sys/nacl_syscalls.h> | |
6 int g_GlobalData = 0; | |
7 void print_line(int count) { | |
8 printf("Running"); | |
9 int i = 0; | |
10 for (i = 0; i < count % 5; ++i) { | |
11 printf("."); | |
12 } | |
13 for (; i < 5; ++i) { | |
14 printf(" "); | |
15 } | |
16 printf("\r"); | |
17 fflush(stdout); | |
18 } | |
19 | |
20 void print_loop() { | |
21 int count = 0; | |
22 timespec t = {1,0}; | |
23 | |
24 while (1) { | |
25 print_line(count); | |
26 ++count; | |
27 nanosleep(&t,0); | |
28 } | |
29 } | |
30 | |
31 void foo() { | |
32 print_loop(); | |
33 } | |
34 | |
35 // We define |print_char_type| so that unit tests can validate | |
36 // getting the value of a 1-byte character using functions such as | |
37 // SymbolValueToString. | |
38 void print_char_type() { | |
39 char c = 'I'; | |
40 printf("c=%c\n", c); | |
41 fflush(stdout); | |
42 } | |
43 | |
44 int main(int argc, const char *argv[]){ | |
45 int x = 0; | |
46 int y = 9; | |
47 std::string test_string; | |
48 printf("Hello World\n\n x: %d y: %d", x, y); | |
49 g_GlobalData++; | |
50 foo(); | |
51 print_char_type(); | |
52 return 0; | |
53 } | |
OLD | NEW |