diff options
author | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-03-19 22:23:46 +0800 |
---|---|---|
committer | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-03-19 22:23:46 +0800 |
commit | 9bc06dc716ccaae500c4afff69b054d973bfdd17 (patch) | |
tree | 09f5a6f6c6ad7c10e5b791b764a4fd65d3eab271 /modules/base/template.go | |
parent | f0993ae3c806211f956b974be3f40ace7ca2d0fb (diff) | |
parent | 199fdd03360e3c9d1d2fb93fe993e01d115e8312 (diff) |
Merge remote-tracking branch 'origin/master'
Conflicts:
routers/user/user.go
Diffstat (limited to 'modules/base/template.go')
-rw-r--r-- | modules/base/template.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/base/template.go b/modules/base/template.go index db79340e..23d3d277 100644 --- a/modules/base/template.go +++ b/modules/base/template.go @@ -6,7 +6,9 @@ package base import ( "container/list" + "fmt" "html/template" + "time" ) func Str2html(raw string) template.HTML { @@ -40,6 +42,9 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{ "AppDomain": func() string { return Domain }, + "LoadTimes": func(startTime time.Time) string { + return fmt.Sprint(time.Since(startTime).Nanoseconds()/1e6) + "ms" + }, "AvatarLink": AvatarLink, "str2html": Str2html, "TimeSince": TimeSince, |