diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-19 10:01:50 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-19 10:01:50 -0400 |
commit | 8e1f339fd69806af1edafc152fab0009105d4220 (patch) | |
tree | 9541c9638cca9b67ea3170471d1754cce5031e0d /modules/base/template.go | |
parent | dd8e7868ce78216faf563d4f232a87cb416eeff4 (diff) | |
parent | 56af7e99a819758c6bedc6d745a9f810f3fc050d (diff) |
Merge branch 'master' of github.com:gogits/gogs
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, |