mirror of
https://github.com/hex248/ob248.com.git
synced 2026-02-08 10:43:38 +00:00
updateTimeAlive -> updateTimeSince
This commit is contained in:
@@ -11,7 +11,7 @@ const uniqueId = `time-since-${Math.random().toString(36).substring(2, 9)}`;
|
|||||||
let interval = 1; // ms
|
let interval = 1; // ms
|
||||||
let msElapsed = 0;
|
let msElapsed = 0;
|
||||||
|
|
||||||
function updateTimeAlive() {
|
function updateTimeSince() {
|
||||||
let years = roundToDp(
|
let years = roundToDp(
|
||||||
(currentTimeMS - dateMS + msElapsed) / (60 * 60 * 24 * 365.25 * 1000),
|
(currentTimeMS - dateMS + msElapsed) / (60 * 60 * 24 * 365.25 * 1000),
|
||||||
2
|
2
|
||||||
@@ -29,10 +29,10 @@ const uniqueId = `time-since-${Math.random().toString(36).substring(2, 9)}`;
|
|||||||
return Math.floor(num * factor) / factor;
|
return Math.floor(num * factor) / factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTimeAlive();
|
updateTimeSince();
|
||||||
|
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
msElapsed += interval;
|
msElapsed += interval;
|
||||||
updateTimeAlive();
|
updateTimeSince();
|
||||||
}, interval);
|
}, interval);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user