Skip to content

Instantly share code, notes, and snippets.

@Oipo
Created August 20, 2019 11:06
Show Gist options
  • Save Oipo/eac59b252a9b3ec6c7d16968d090ec6d to your computer and use it in GitHub Desktop.
Save Oipo/eac59b252a9b3ec6c7d16968d090ec6d to your computer and use it in GitHub Desktop.
import { CensorSensor } from 'censor-sensor';
declare function require(name:string);
const { PerformanceObserver, performance } = require('perf_hooks');
//import { performance } from 'perf_hooks';
const censor = new CensorSensor();
let start = performance.now();
for(let i = 0; i < 10000000; i++) {
censor.isProfane("this is bollocks");
}
let end = performance.now() - start;
console.log(`time: ${end}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment