We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fdcd311 commit e03d269Copy full SHA for e03d269
1 file changed
src/FSharp.Control.AsyncSeq/AsyncSeq.fs
@@ -5,6 +5,7 @@
5
namespace FSharp.Control
6
7
open System
8
+open System.Diagnostics
9
open System.IO
10
open System.Collections.Generic
11
open System.Threading
@@ -1025,10 +1026,10 @@ module AsyncSeq =
1025
1026
match rem with
1027
| Some rem -> async.Return rem
1028
| None -> Async.StartChildAsTask(ie.MoveNext())
- let t = DateTime.Now
1029
+ let t = Stopwatch.GetTimestamp()
1030
let! time = Async.StartChildAsTask(Async.Sleep (max 0 rt))
1031
let! moveOr = Async.chooseTasks move time
- let delta = int (DateTime.Now - t).TotalMilliseconds
1032
+ let delta = int ((Stopwatch.GetTimestamp() - t) * 1000L / Stopwatch.Frequency)
1033
match moveOr with
1034
| Choice1Of2 (None, _) ->
1035
if buffer.Count > 0 then
0 commit comments