aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/gc_test.go2
-rw-r--r--src/runtime/metrics_test.go2
-rw-r--r--src/runtime/runtime_test.go2
-rw-r--r--src/runtime/testdata/testprog/gc.go2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/gc_test.go b/src/runtime/gc_test.go
index 122818fbfe..0b2c972d3f 100644
--- a/src/runtime/gc_test.go
+++ b/src/runtime/gc_test.go
@@ -689,7 +689,7 @@ func BenchmarkReadMemStatsLatency(b *testing.B) {
time.Sleep(100 * time.Millisecond)
start := time.Now()
runtime.ReadMemStats(&ms)
- latencies = append(latencies, time.Now().Sub(start))
+ latencies = append(latencies, time.Since(start))
}
// Make sure to stop the timer before we wait! The load created above
// is very heavy-weight and not easy to stop, so we could end up
diff --git a/src/runtime/metrics_test.go b/src/runtime/metrics_test.go
index b4d921b82e..d981c8ee00 100644
--- a/src/runtime/metrics_test.go
+++ b/src/runtime/metrics_test.go
@@ -375,7 +375,7 @@ func BenchmarkReadMetricsLatency(b *testing.B) {
for i := 0; i < b.N; i++ {
start := time.Now()
metrics.Read(samples)
- latencies = append(latencies, time.Now().Sub(start))
+ latencies = append(latencies, time.Since(start))
}
// Make sure to stop the timer before we wait! The load created above
// is very heavy-weight and not easy to stop, so we could end up
diff --git a/src/runtime/runtime_test.go b/src/runtime/runtime_test.go
index 018a8dbaa6..2faf06e2b9 100644
--- a/src/runtime/runtime_test.go
+++ b/src/runtime/runtime_test.go
@@ -377,7 +377,7 @@ func BenchmarkGoroutineProfile(b *testing.B) {
if !ok {
b.Fatal("goroutine profile failed")
}
- latencies = append(latencies, time.Now().Sub(start))
+ latencies = append(latencies, time.Since(start))
}
b.StopTimer()
diff --git a/src/runtime/testdata/testprog/gc.go b/src/runtime/testdata/testprog/gc.go
index 0f44575381..5dc85fbb62 100644
--- a/src/runtime/testdata/testprog/gc.go
+++ b/src/runtime/testdata/testprog/gc.go
@@ -396,7 +396,7 @@ func gcMemoryLimit(gcPercent int) {
// should do considerably better than this bound.
bound := int64(myLimit + 16<<20)
start := time.Now()
- for time.Now().Sub(start) < 200*time.Millisecond {
+ for time.Since(start) < 200*time.Millisecond {
metrics.Read(m[:])
retained := int64(m[0].Value.Uint64() - m[1].Value.Uint64())
if retained > bound {