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
;(function (exports) { | |
let tid = 0 | |
const timers = new Map() | |
const jsblob = ` | |
const timers = new Map() | |
const runTimer = function (id) { | |
this.postMessage({ id }) | |
timers.delete(id) | |
} | |
this.addEventListener('message', (evt) => { |
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
{"_id":"60d90843f2de503b38cedd21","asks":[{"price":"34335.41","volume":"2.945558"},{"price":"34336.91","volume":"1.957166"},{"price":"34336.92","volume":"0.198337"},{"price":"34337.14","volume":"0.58016"},{"price":"34337.18","volume":"0.062053"},{"price":"34340.25","volume":"0.089595"},{"price":"34340.62","volume":"0.093975"},{"price":"34341.99","volume":"0.224002"},{"price":"34342","volume":"0.64"},{"price":"34342.83","volume":"0.187001"}],"bids":[{"price":"34335.4","volume":"0.487535"},{"price":"34333.82","volume":"0.040469"},{"price":"34332.59","volume":"0.004369"},{"price":"34329.53","volume":"0.000295"},{"price":"34326.78","volume":"0.251112"},{"price":"34326.77","volume":"0.4"},{"price":"34325.02","volume":"0.317457"},{"price":"34325.01","volume":"0.19687"},{"price":"34325","volume":"0.001"},{"price":"34323.03","volume":"0.307214"}],"seq":553600,"time":"2021-06-27T16: 22: 42.984-07: 00"} |
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
/** | |
* FizzBuzz short and quick method. | |
*/ | |
const fizzbuzz = (int) => !(int % 15) ? "FizzBuzz" : !(int % 5) ? "Buzz" : !(int % 3) ? "Fizz" : int; | |
let i = 1; | |
console.log(new Array(100).fill().map(_ => fizzbuzz(i++))) | |
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
//delay fn | |
const delay = (time) => new Promise((resolve) => setTimeout(resolve, parseInt(time * 1000))); | |
//random fn | |
const random = () => Math.random() * 1.5; | |
const iterationArray = new Array(10); | |
const runFn = async (rounds) => { | |
let i = -1 | |
for await (round of rounds) { | |
const time = random() |
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
void Update() | |
{ | |
if (Input.GetKeyDown(KeyCode.Space)) | |
{ | |
Debug.Log("Rolling"); | |
float time = Time.realtimeSinceStartup; | |
for (int i = 0; i < 10000; i++) | |
{ | |
GenerateSHA512String('abc'); | |
} |
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
//call the module | |
const looper = require('./looper') | |
//create an object to pass to the loop module | |
const loopOptions = { | |
fn: () => Math.random(), | |
max: 1e9 | |
} | |
looper(loopOptions); |