| 144 | } |
| 145 | |
| 146 | void iter() { |
| 147 | if (frameCounter < FRAMES) { |
| 148 | clock_t start = clock(); |
| 149 | world->Step(1.0f/60.0f, 3, 3); |
| 150 | clock_t end = clock(); |
| 151 | clock_t curr = end - start; |
| 152 | times[frameCounter] = curr; |
| 153 | if (curr < minn) minn = curr; |
| 154 | if (curr > maxx) maxx = curr; |
| 155 | #if DEBUG |
| 156 | printf("%f :: ", topBody->GetPosition().y); |
| 157 | printf("%f\n", (float32)(end - start) / CLOCKS_PER_SEC * 1000); |
| 158 | #endif |
| 159 | frameCounter++; |
| 160 | return; |
| 161 | } |
| 162 | |
| 163 | // that's it! |
| 164 | |
| 165 | frameCounter++; |
| 166 | |
| 167 | result_t result = measure(times); |
| 168 | |
| 169 | printf("frame averages: %.3f +- %.3f, range: %.3f to %.3f \n", result.mean, result.stddev, float(minn)/CLOCKS_PER_SEC * 1000, float(maxx)/CLOCKS_PER_SEC * 1000); |
| 170 | } |
| 171 |
no test coverage detected