| 405 | } |
| 406 | |
| 407 | double delayInBenchmark() { |
| 408 | int count = 1000000; |
| 409 | uint64_t x = 0; |
| 410 | uint64_t start = Cycles::rdtsc(); |
| 411 | for (int i = 0; i < count; i++) { |
| 412 | function(0); |
| 413 | } |
| 414 | uint64_t stop = Cycles::rdtsc(); |
| 415 | |
| 416 | discard(&cntr); |
| 417 | return Cycles::toSeconds(stop - start)/(count); |
| 418 | } |
| 419 | |
| 420 | // Measure the cost of a 32-bit divide. Divides don't take a constant |
| 421 | // number of cycles. Values were chosen here semi-randomly to depict a |