({ n, type, method })
| 35 | } |
| 36 | |
| 37 | function main({ n, type, method }) { |
| 38 | let path; |
| 39 | |
| 40 | switch (type) { |
| 41 | case 'existing': |
| 42 | path = __filename; |
| 43 | break; |
| 44 | case 'non-flat-existing': |
| 45 | path = tmpfile; |
| 46 | break; |
| 47 | case 'non-existing': |
| 48 | path = tmpdir.resolve(`.non-existing-file-${process.pid}`); |
| 49 | break; |
| 50 | default: |
| 51 | new Error('Invalid type'); |
| 52 | } |
| 53 | |
| 54 | if (method === 'access') { |
| 55 | // Warmup the filesystem - it doesn't need to use the async method |
| 56 | runBench(n, path); |
| 57 | |
| 58 | bench.start(); |
| 59 | runAsyncBench(n, path); |
| 60 | } else { |
| 61 | // warmup |
| 62 | runBench(n, path); |
| 63 | |
| 64 | bench.start(); |
| 65 | runBench(n, path); |
| 66 | bench.end(n); |
| 67 | } |
| 68 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…