From d62d929a18611b7fb3ad7ce8577508d181940f21 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 15 Jul 2022 09:39:25 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20`/=E8=B5=84=E6=BA=90`=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=90=9C=E7=B4=A2=E6=9C=AA=E7=B4=A2=E5=BC=95=E7=9A=84?= =?UTF-8?q?=E6=96=87=E4=BB=B6=20https://github.com/siyuan-note/siyuan/issu?= =?UTF-8?q?es/5416?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/cache/asset.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/cache/asset.go b/kernel/cache/asset.go index d66fd6a95..c958561b5 100644 --- a/kernel/cache/asset.go +++ b/kernel/cache/asset.go @@ -21,6 +21,7 @@ import ( "path/filepath" "strings" "sync" + "time" "github.com/siyuan-note/siyuan/kernel/util" ) @@ -34,6 +35,7 @@ type Asset struct { var Assets = sync.Map{} func LoadAssets() { + start := time.Now() Assets = sync.Map{} assets := filepath.Join(util.DataDir, "assets") filepath.Walk(assets, func(path string, info fs.FileInfo, err error) error { @@ -56,4 +58,8 @@ func LoadAssets() { }) return nil }) + elapsed := time.Since(start) + if 2000 < elapsed.Milliseconds() { + util.LogInfof("loaded assets [%s]", elapsed) + } }