| 2 | #include "fix.h" |
| 3 | |
| 4 | void fix_benchmarks() { |
| 5 | hc_time_t t; |
| 6 | const int n = 100000; |
| 7 | |
| 8 | t = hc_now(); |
| 9 | double dv = 0; |
| 10 | |
| 11 | for (int i = 0; i < n; i++) { |
| 12 | dv += 0.001; |
| 13 | } |
| 14 | |
| 15 | hc_time_print(&t, "double: "); |
| 16 | |
| 17 | t = hc_now(); |
| 18 | hc_fix_t fv = hc_fix(3, 0); |
| 19 | hc_fix_t fd = hc_fix(3, 1); |
| 20 | |
| 21 | for (int i = 0; i < n; i++) { |
| 22 | fv = hc_fix_add(fv, fd); |
| 23 | } |
| 24 | |
| 25 | hc_time_print(&t, "fix: "); |
| 26 | } |
no test coverage detected