Last active
May 30, 2023 07:05
-
-
Save hobione2k/2260308e1f1d1aedc2fc5cd68ef97b91 to your computer and use it in GitHub Desktop.
ClusterScript-時刻付きログ
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
const pad = (n, l = 2) => { | |
return n.toString().padStart(l, "0"); | |
}; | |
const now = () => { | |
const d = new Date(); | |
const time = `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad( | |
d.getSeconds() | |
)}.${pad(d.getMilliseconds(), 3)}`; | |
return time; | |
}; | |
const log = (...msg) => $.log(`${now()} ${msg.join()}`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
使い方