UNPKG

545 BJavaScriptView Raw
1var Benchmark = require('benchmark'),
2 fs = require('fs'),
3 hint = require('./');
4
5global.dataString = fs.readFileSync('test/data/bad/bad-polygonloop.geojson');
6global.dataObject = JSON.parse(global.dataString);
7var suite = new Benchmark.Suite('turf-within');
8suite
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();