should use time.Since instead of time.Now().Sub

This commit is contained in:
Wang Guoliang
2018-02-11 21:17:00 +08:00
committed by Guoliang Wang
parent a5c3c8d16c
commit 89669283fe
25 changed files with 39 additions and 38 deletions

View File

@@ -415,7 +415,7 @@ func (ssc *StatefulSetController) worker() {
func (ssc *StatefulSetController) sync(key string) error {
startTime := time.Now()
defer func() {
glog.V(4).Infof("Finished syncing statefulset %q (%v)", key, time.Now().Sub(startTime))
glog.V(4).Infof("Finished syncing statefulset %q (%v)", key, time.Since(startTime))
}()
namespace, name, err := cache.SplitMetaNamespaceKey(key)