I hereby claim:
- I am sethmcleod on github.
- I am sth (https://keybase.io/sth) on keybase.
- I have a public key ASCK_WFe5zbkzzdzLhxi3vtRnyIW11UkOB-486-6MQJPfgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| function debounce(func, wait, immediate) { | |
| let timeout; | |
| return function() { | |
| const context = this, args = arguments; | |
| const later = function() { | |
| timeout = null; | |
| if (!immediate) { | |
| func.apply(context, args); | |
| } | |
| }; |
| function speedTest(testImplement, testParams, repetitions = 10000) { | |
| // code to be tested | |
| this.testImplement = testImplement; | |
| // parameters needed for code | |
| this.testParams = testParams; | |
| // optional number of reps; higher = better average | |
| this.repetitions = repetitions; | |
| this.average = 0; | |
| } |