|
| 1 | + |
| 2 | +# Accuracy test |
| 3 | + |
| 4 | +This file summarizes accuracy test for loops of constant duration using the `oclock.Timer` class. Tests are done using the performance_test function (see *Readme.md*), e.g. |
| 5 | +```python |
| 6 | +from oclock.performance import performance_test |
| 7 | +performance_test(dt=0.1, nloops=1000, fmax=0.5, plot=True, precise=True) |
| 8 | +``` |
| 9 | + |
| 10 | +Below are some results on timing accuracy in an Unix Environment (MacOS) and Windows, using `nloops=1000`, `fmax=0.5` for various values of `dt`. *Regular Timer* means with `precise=False` while *Precise Timer* means with `precise=True`. |
| 11 | + |
| 12 | +## Unix |
| 13 | + |
| 14 | +### Regular Timer |
| 15 | + |
| 16 | +| Requested `dt` (ms) | 1000 | 100 | 40 | 10 | 1 | |
| 17 | +|:----------------------------------:|:------:|:-------:|:-------:|:-------:|:-------:| |
| 18 | +| average `dt` - requested `dt` (ms) | 0.0012 | 0.00012 | 0.00016 | 0.00005 | 0.00023 | |
| 19 | +| standard deviation in `dt` (ms) | 0.48 | 0.36 | 0.31 | 0.23 | 0.08 | |
| 20 | + |
| 21 | +Corresponding graphs: |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +### Precise Timer |
| 35 | + |
| 36 | +| Requested `dt` (ms) | 1000 | 100 | 40 | 10 | 1 | |
| 37 | +|:----------------------------------:|:------:|:-------:|:-------:|:-------:|:-------:| |
| 38 | +| average `dt` - requested `dt` (ms) | 3.6E-5 | 3.4E-5 | 2.8E-5 | 3.0E-5 | 1.2E-5 | |
| 39 | +| standard deviation in `dt` (ms) | 0.0118 | 0.0104 | 0.0117 | 0.0105 | 0.0073 | |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +## Windows |
| 53 | + |
| 54 | +### Regular Timer |
| 55 | + |
| 56 | +| Requested `dt` (ms) | 1000 | 100 | 40 | 10 | 1 | |
| 57 | +|:----------------------------------:|:-----:|:-------:|:-------:|:-------:|:---:| |
| 58 | +| average `dt` - requested `dt` (ms) | 0.014 | 0.0015 | 0.0013 | 1.2 | 1.1 | |
| 59 | +| standard deviation in `dt` (ms) | 7.0 | 7.1 | 7.0 | 5.6 | 1.9 | |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | +### Precise Timer |
| 74 | + |
| 75 | + |
| 76 | +| Requested `dt` (ms) | 1000 | 100 | 40 | 10 | 1 | |
| 77 | +|:----------------------------------:|:------:|:-------:|:-------:|:-------:|:-------:| |
| 78 | +| average `dt` - requested `dt` (ms) | 1.3E-5 | 1.5E-5 | 1.6E-5 | 6.7E-6 | 1.5E-6 | |
| 79 | +| standard deviation in `dt` (ms) | 0.0066 | 0.0100 | 0.0088 | 0.0068 | 0.0036 | |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
0 commit comments