This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const history = Array(1500); | |
let history_total = 0; | |
const MDELAY_MS = 1; | |
let counter = 0; | |
function measure() { | |
setTimeout((start) => { | |
const diff = process.hrtime(start); | |
const lag = Math.max(0, diff[0] * 1e3 + diff[1] / 1e6 - MDELAY_MS); | |
const index = counter++ % history.length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require('lodash'); | |
var rW = "0-9a-zа-я", | |
rSpace = /[\s_]+/g, | |
rFeat = rFeatSoft = new RegExp('[^'+rW+']((?:featuring|feat|ft|&|vs|при уч|п\.у\.)[^'+rW+']+)', 'g'), | |
rU = /[ù-üийі]/g, | |
rE = /[è-ëёеє]/g, | |
rI = /[ì-ï]/g, | |
rA = /[à-æ]/g, | |
rO = /[ò-ö]/g, |