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

This commit is contained in:
wangguoliang
2017-08-21 10:03:18 +08:00
parent e633a1604f
commit c2ed2bc21c
3 changed files with 3 additions and 3 deletions

View File

@@ -560,7 +560,7 @@ func (dc *DeploymentController) syncDeployment(key string) error {
startTime := time.Now()
glog.V(4).Infof("Started syncing deployment %q (%v)", key, startTime)
defer func() {
glog.V(4).Infof("Finished syncing deployment %q (%v)", key, time.Now().Sub(startTime))
glog.V(4).Infof("Finished syncing deployment %q (%v)", key, time.Since(startTime))
}()
namespace, name, err := cache.SplitMetaNamespaceKey(key)