1 | var Benchmark = require('benchmark'),
|
2 | fs = require('fs'),
|
3 | hint = require('./');
|
4 |
|
5 | global.dataString = fs.readFileSync('test/data/bad/bad-polygonloop.geojson');
|
6 | global.dataObject = JSON.parse(global.dataString);
|
7 | var suite = new Benchmark.Suite('turf-within');
|
8 | suite
|
9 | .add('hint-string',function () {
|
10 | hint.hint(global.dataString);
|
11 | })
|
12 | .add('hint-object',function () {
|
13 | hint.hint(global.dataObject);
|
14 | })
|
15 | .on('cycle', function (event) {
|
16 | console.log(String(event.target));
|
17 | })
|
18 | .on('complete', function () {
|
19 | })
|
20 | .run();
|