From ee7af0841fc2e0ac4b0460891360c035d8b1a624 Mon Sep 17 00:00:00 2001 From: chxuan <787280310@qq.com> Date: Sat, 26 Oct 2019 09:40:28 +0800 Subject: [PATCH] update update.sh --- update.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/update.sh b/update.sh index 1dcbc05..e7b9a14 100755 --- a/update.sh +++ b/update.sh @@ -67,9 +67,18 @@ function update_vimplus_on_linux() print_logo } +# 获取当前时间戳 +function get_now_timestamp() +{ + cur_sec_and_ns=`date '+%s-%N'` + echo ${cur_sec_and_ns%-*} +} + # main函数 function main() { + begin=`get_now_timestamp` + type=`get_platform_type` echo "Platform type: "${type} @@ -80,6 +89,11 @@ function main() else echo "Not support platform type: "${type} fi + + end=`get_now_timestamp` + second=`expr ${end} - ${begin}` + min=`expr ${second} / 60` + echo "It takes "${min}" minutes." } # 调用main函数