UNPKG

688 BJavaScriptView Raw
1var sample = require('./');
2var Benchmark = require('benchmark');
3var fs = require('fs');
4var featurecollection = require('turf-helpers').featureCollection;
5var point = require('turf-helpers').point;
6
7var points = featureCollection(
8 [point(1,2, {team: 'Red Sox'}),
9 point(2,1, {team: 'Yankees'}),
10 point(3,1, {team: 'Nationals'}),
11 point(2,2, {team: 'Yankees'}),
12 point(2,3, {team: 'Red Sox'}),
13 point(4,2, {team: 'Yankees'})]);
14
15var suite = new Benchmark.Suite('turf-sample');
16suite
17 .add('turf-sample',function () {
18 sample(points, 4);
19 })
20 .on('cycle', function (event) {
21 console.log(String(event.target));
22 })
23 .on('complete', function () {
24
25 })
26 .run();
\No newline at end of file