feat: setup logours for logging

This commit is contained in:
Lakhan Samani
2022-05-13 00:47:01 +05:30
parent 773213e5a4
commit da0fcb109b
21 changed files with 93 additions and 82 deletions

12
server/utils/time.go Normal file
View File

@@ -0,0 +1,12 @@
package utils
import "time"
// GetDurationInMillseconds takes a start time and returns a duration in milliseconds
func GetDurationInMillseconds(start time.Time) float64 {
end := time.Now()
duration := end.Sub(start)
milliseconds := float64(duration) / float64(time.Millisecond)
rounded := float64(int(milliseconds*100+.5)) / 100
return rounded
}