瀏覽代碼

Log sleep time.

Richard Crowley 12 年之前
父節點
當前提交
90699f3f70
共有 2 個文件被更改,包括 6 次插入2 次删除
  1. 3 1
      debug_test.go
  2. 3 1
      runtime_test.go

+ 3 - 1
debug_test.go

@@ -26,7 +26,9 @@ func TestDebugGCStatsBlocking(t *testing.T) {
 	t1 := time.Now()
 	t.Log("i++ during debug.ReadGCStats:", <-ch)
 	go testDebugGCStatsBlocking(ch)
-	time.Sleep(t1.Sub(t0))
+	d := t1.Sub(t0)
+	t.Log(d)
+	time.Sleep(d)
 	t.Log("i++ during time.Sleep:", <-ch)
 }
 

+ 3 - 1
runtime_test.go

@@ -25,7 +25,9 @@ func TestRuntimeMemStatsBlocking(t *testing.T) {
 	t1 := time.Now()
 	t.Log("i++ during runtime.ReadMemStats:", <-ch)
 	go testRuntimeMemStatsBlocking(ch)
-	time.Sleep(t1.Sub(t0))
+	d := t1.Sub(t0)
+	t.Log(d)
+	time.Sleep(d)
 	t.Log("i++ during time.Sleep:", <-ch)
 }