Skip to content

Commit

Permalink
Use Stopwatch.StartNew() (#2403)
Browse files Browse the repository at this point in the history
  • Loading branch information
mic-max authored Sep 22, 2021
1 parent 15981df commit 256fc2d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions test/OpenTelemetry.Tests/Metrics/MetricAPITest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,7 @@ void ProcessExport(Batch<Metric> batch)
// Block until all threads started.
mreToEnsureAllThreadsStarted.WaitOne();

Stopwatch sw = new Stopwatch();
sw.Start();
Stopwatch sw = Stopwatch.StartNew();

// unblock all the threads.
// (i.e let them start counter.Add)
Expand Down Expand Up @@ -354,8 +353,7 @@ void ProcessExport(Batch<Metric> batch)
// Block until all threads started.
mreToEnsureAllThreadsStarted.WaitOne();

Stopwatch sw = new Stopwatch();
sw.Start();
Stopwatch sw = Stopwatch.StartNew();

// unblock all the threads.
// (i.e let them start counter.Add)
Expand Down
3 changes: 1 addition & 2 deletions test/StressTestMetrics/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public static void Main(string[] args)
using var meterProvider = Sdk.CreateMeterProviderBuilder()
.AddSource("TestMeter")
.Build();
Stopwatch sw = new Stopwatch();
sw.Start();
Stopwatch sw = Stopwatch.StartNew();

Parallel.Invoke(
() =>
Expand Down

0 comments on commit 256fc2d

Please sign in to comment.