mirror of
https://github.com/Turfjs/turf.git
synced 2026-01-25 16:07:00 +00:00
* @typescript-eslint/ban-types * @typescript-eslint/no-empty-function * @typescript-eslint/no-inferrable-types * @typescript-eslint/no-this-alias * no-case-declarations * no-cond-assign * no-dupe-else-if * no-empty * no-explicit-any * no-prototype-builtins * no-undef * no-unreachable * no-useless-escape * prefer-spread * comment the eslintrc * Almost had it * clearly my js trivia is not good enough today Co-authored-by: Matt Fedderly <mfedderly@palantir.com>
22 lines
567 B
JavaScript
22 lines
567 B
JavaScript
import Benchmark from "benchmark";
|
|
import { point, featureCollection } from "@turf/helpers";
|
|
import sample from "./index";
|
|
|
|
var points = featureCollection([
|
|
point(1, 2, { team: "Red Sox" }),
|
|
point(2, 1, { team: "Yankees" }),
|
|
point(3, 1, { team: "Nationals" }),
|
|
point(2, 2, { team: "Yankees" }),
|
|
point(2, 3, { team: "Red Sox" }),
|
|
point(4, 2, { team: "Yankees" }),
|
|
]);
|
|
|
|
new Benchmark.Suite("turf-sample")
|
|
.add("turf-sample", function () {
|
|
sample(points, 4);
|
|
})
|
|
.on("cycle", function (event) {
|
|
console.log(String(event.target));
|
|
})
|
|
.run();
|