Add stopswatch for speed of Get()

This commit is contained in:
Peter Stuifzand 2020-10-31 23:28:47 +01:00
parent ca8afb0cbe
commit cdc7f1a30c

View File

@ -151,6 +151,8 @@ func convertBlocksToListItems(current string, blocks BlockResponse, indent int)
}
func (fp *FilePages) Get(title string) Page {
var sw stopwatch
sw.Start("Get " + title)
// TODO: cleanup loading of pages
// TODO: convert all pages to blocks
name := title
@ -206,6 +208,8 @@ func (fp *FilePages) Get(title string) Page {
err = json.NewEncoder(&buf).Encode(&listItems)
sw.Stop()
return Page{
Name: name,
Title: blocks.Texts[name],