This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
src/System.Diagnostics.Process/src/System/Diagnostics Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ internal bool WaitForExit(int millisecondsTimeout)
367
367
Debug . Assert ( ! Monitor . IsEntered ( _gate ) ) ;
368
368
369
369
// Track the time the we start waiting.
370
- long startTime = GetTimestamp ( ) ;
370
+ long startTime = Stopwatch . GetTimestamp ( ) ;
371
371
372
372
// Polling loop
373
373
while ( true )
@@ -379,7 +379,7 @@ internal bool WaitForExit(int millisecondsTimeout)
379
379
// We're in a polling loop... determine how much time remains
380
380
int remainingTimeout = millisecondsTimeout == Timeout . Infinite ?
381
381
Timeout . Infinite :
382
- ( int ) Math . Max ( millisecondsTimeout - ( GetTimestamp ( ) - startTime ) , 0 ) ;
382
+ ( int ) Math . Max ( millisecondsTimeout - ( ( Stopwatch . GetTimestamp ( ) - startTime ) / ( double ) Stopwatch . Frequency * 1000 ) , 0 ) ;
383
383
384
384
lock ( _gate )
385
385
{
@@ -511,11 +511,5 @@ internal bool WaitForExit(int millisecondsTimeout)
511
511
} ) ;
512
512
}
513
513
514
- /// <summary>Gets a current time stamp.</summary>
515
- private static long GetTimestamp ( )
516
- {
517
- return Stopwatch . GetTimestamp ( ) ;
518
- }
519
-
520
514
}
521
515
}
You can’t perform that action at this time.
0 commit comments