Skip to content

Instantly share code, notes, and snippets.

@the8472
Created November 13, 2015 17:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save the8472/4f5efa0f1f968b738706 to your computer and use it in GitHub Desktop.
Save the8472/4f5efa0f1f968b738706 to your computer and use it in GitHub Desktop.
// ==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