From c0738bc0fc74ae1151c7e1bebd28245e30d2e559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=81=94=E7=9B=9F=E5=B0=91=E4=BE=A0?= Date: Mon, 27 Mar 2023 20:23:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E8=80=97=E6=97=B6?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- receiver/receiver.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/receiver/receiver.go b/receiver/receiver.go index a1dc977..5d5f4e2 100644 --- a/receiver/receiver.go +++ b/receiver/receiver.go @@ -4,6 +4,7 @@ import ( "115push/login" "115push/utils" "encoding/json" + "fmt" "github.com/deadblue/elevengo" "io" "log" @@ -16,6 +17,7 @@ import ( func Import(dirid, url, shareCid string) { login.Login() + startT := time.Now() //计算当前时间 var tickets utils.FileList // 去掉最右边的 / url = strings.TrimRight(url, "/") @@ -41,7 +43,13 @@ func Import(dirid, url, shareCid string) { importFileForDir(firstDirID, url, &tickets, wg) wg.producerWaitGroupPool.Wait() close(wg.taskChannel) - + tc := time.Since(startT) //计算耗时 + hours := int(tc.Hours()) + minutes := int(tc.Minutes()) % 60 + seconds := int(tc.Seconds()) % 60 + fmt.Println() + log.Printf("本次导入:共计耗时 %02d:%02d:%02d\n", hours, minutes, seconds) + fmt.Println() } func importFileForDir(dirid, url string, tickets *utils.FileList, wg *importer) {