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;