(N/sec)
by
noromanba
2018-01-09 [2018/01/09 09:23:05]
timer throttling checker
@@ -1,14 +1,14 @@
/*
* @title (N/sec)
- * @description timer throttling checker w/ await
+ * @description timer throttling checker
* @include *
* @license MIT License https://opensource.org/licenses/MIT
* @javascript_url
*/
-// background tab throttling
+// background tab/window timer throttling
// Firefox 57.0.4 | N/~1sec
-// Firefox mobile 57.0.4 | N/~1sec or pause; Thumbnail -> switch -> Thumbnail
+// Firefox mobile 57.0.4 | N/~1sec or N/Inf(pause); Thumbnail -> switch -> Thumbnail
// Chromium 63.0.3239.108 | N/~2sec
(async () => {
(async () => {
'use strict';
const sleep = (wait = 1 * 1000) => {
return new Promise(res => setTimeout(res, wait));
};
const _title = document.title;
const n = 100;
for (let i = 0; i < n; i += 1) {
const remain = String(n - i).padStart(String(n).length, '0');
const time = new Date().toTimeString().slice(0, 8);
document.title = [
'(' + remain + ')',
time,
'-',
_title,
].join(' ');
console && console.debug && console.debug(remain, time);
await sleep();
}
document.title = _title;
})();
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。