File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,6 +211,16 @@ fn configure_wait_stream(
211211 }
212212}
213213
214+ fn duration_ms ( left : Timestamp , right : Timestamp ) -> Int {
215+ left
216+ |> timestamp . difference ( right )
217+ |> duration . to_seconds_and_nanoseconds
218+ |> fn ( seconds_nanoseconds ) {
219+ let # ( seconds , nanoseconds ) = seconds_nanoseconds
220+ seconds * 1000 + nanoseconds / 1_000_000
221+ }
222+ }
223+
214224fn do_execute (
215225 wait_stream wait_stream : Yielder ( Int ) ,
216226 allow allow : fn ( b) -> Bool ,
@@ -233,16 +243,7 @@ fn do_execute(
233243 True , yielder . Next ( wait_time , wait_stream ) -> {
234244 wait_function ( wait_time )
235245 let wait_time_acc = [ wait_time , .. wait_time_acc ]
236-
237- let duration =
238- start_time
239- |> timestamp . difference ( clock . now ( clock ) )
240- |> duration . to_seconds_and_nanoseconds
241- |> fn ( seconds_nanoseconds ) {
242- let # ( seconds , nanoseconds ) = seconds_nanoseconds
243- let milliseconds = seconds * 1000 + nanoseconds / 1_000_000
244- milliseconds
245- }
246+ let duration = duration_ms ( start_time , clock . now ( clock ) )
246247
247248 case operation ( attempt ) {
248249 Ok ( result ) ->
You can’t perform that action at this time.
0 commit comments