Created
November 13, 2015 17:03
-
-
Save the8472/4f5efa0f1f968b738706 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// ==UserScript== | |
// @name test | |
// @namespace https://github.com/the8472 | |
// @include * | |
// @version 1 | |
// @grant GM_setValue | |
// @grant GM_getValue | |
// @run-at document-end | |
// ==/UserScript== | |
'use strict'; | |
GM_setValue("foo", "bar"); | |
const iters = 10000; | |
function bench() { | |
let start = performance.now(); | |
for(let i=0;i<iters;i++) { | |
GM_getValue("foo") | |
} | |
let duration = performance.now() - start; | |
console.log(duration) | |
} | |
for(let j=0;j<10;j++) { | |
bench(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment