| 102 | } |
| 103 | |
| 104 | int main(int argc, char* argv[]) { |
| 105 | int ch; |
| 106 | |
| 107 | while ((ch = getopt(argc, argv, "hn:")) > 0) { |
| 108 | switch (ch) { |
| 109 | case 'h': |
| 110 | usage(argv[0]); |
| 111 | return 0; |
| 112 | case 'n': |
| 113 | max = atoi(optarg); |
| 114 | if (max < 100) { |
| 115 | max = 100; |
| 116 | } |
| 117 | break; |
| 118 | default: |
| 119 | usage(argv[0]); |
| 120 | return 0; |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | ////////////////////////////////////////////////////////////////////// |
| 125 | |
| 126 | struct timeval begin, end; |
| 127 | |
| 128 | ////////////////////////////////////////////////////////////////////// |
| 129 | |
| 130 | gettimeofday(&begin, NULL); |
| 131 | test1(); |
| 132 | gettimeofday(&end, NULL); |
| 133 | |
| 134 | double tc = util::stamp_sub(&end, &begin); |
| 135 | printf("Test1 time cost: %.2f ms\r\n", tc); |
| 136 | printf("--------------------------------------------------------\r\n"); |
| 137 | |
| 138 | ////////////////////////////////////////////////////////////////////// |
| 139 | |
| 140 | gettimeofday(&begin, NULL); |
| 141 | test2(); |
| 142 | gettimeofday(&end, NULL); |
| 143 | |
| 144 | tc = util::stamp_sub(&end, &begin); |
| 145 | printf("Test2 time cost: %.2f ms\r\n", tc); |
| 146 | printf("--------------------------------------------------------\r\n"); |
| 147 | |
| 148 | ////////////////////////////////////////////////////////////////////// |
| 149 | |
| 150 | gettimeofday(&begin, NULL); |
| 151 | test3(); |
| 152 | gettimeofday(&end, NULL); |
| 153 | |
| 154 | tc = util::stamp_sub(&end, &begin); |
| 155 | printf("Test3 time cost: %.2f ms\r\n", tc); |
| 156 | printf("--------------------------------------------------------\r\n"); |
| 157 | |
| 158 | ////////////////////////////////////////////////////////////////////// |
| 159 | |
| 160 | gettimeofday(&begin, NULL); |
| 161 | test4(); |
nothing calls this directly
no test coverage detected
searching dependent graphs…