From 59b3ef222d3468ccb7096a801a43da7d9b158412 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 4 May 2022 00:46:28 +0800 Subject: [PATCH] 1 --- utils.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils.js b/utils.js index 7201370..806077a 100644 --- a/utils.js +++ b/utils.js @@ -65,6 +65,10 @@ function isOnlineEnv() { return !serverEnv; } +function getTickCount() { + return Math.floor((new Date()).getTime() / 1); +} + function getUtcTime() { return Math.floor((new Date()).getTime() / 1000); } @@ -245,6 +249,7 @@ exports.sleep = sleep; exports.emptyReplace = emptyReplace; exports.throwError = throwError; exports.isOnlineEnv = isOnlineEnv; +exports.getTickCount = getTickCount; exports.getUtcTime = getUtcTime; exports.formatDate = formatDate; exports.pad = pad;