mirror of
https://github.com/Turfjs/turf.git
synced 2026-01-18 16:02:57 +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>
24 lines
399 B
JavaScript
24 lines
399 B
JavaScript
import Benchmark from "benchmark";
|
|
import { polygon } from "@turf/helpers";
|
|
import explode from "./index";
|
|
|
|
var poly = polygon([
|
|
[
|
|
[0, 0],
|
|
[0, 10],
|
|
[10, 10],
|
|
[10, 0],
|
|
[0, 0],
|
|
],
|
|
]);
|
|
|
|
var suite = new Benchmark.Suite("turf-explode");
|
|
suite
|
|
.add("turf-explode", () => {
|
|
explode(poly);
|
|
})
|
|
.on("cycle", (event) => {
|
|
console.log(String(event.target));
|
|
})
|
|
.run();
|