File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -371,6 +371,7 @@ export class Session {
371371 }
372372 }
373373 } else {
374+ let ordersOfMagnitude = 0 ;
374375 while ( true ) {
375376 const followingTimePoint = this . timeCursor . offsetByFemtos ( this . _forwardTimeStep ) ;
376377 const response = await this . connection . queryInterval ( {
@@ -382,12 +383,15 @@ export class Session {
382383 item_values_encoding : null ,
383384 diagnostics : false
384385 } ) ;
385- if ( response . samples . length === 1 ) {
386- this . _forwardTimeStep = this . _forwardTimeStep * 2n ;
387- continue ;
386+ if ( response . samples . length > 1 ) {
387+ this . timeCursor = TimePoint . fromCXXRTL ( response . samples . at ( 1 ) ! . time ) ;
388+ break ;
389+ } else if ( ordersOfMagnitude < 30 /* femto -> peta */ ) {
390+ ordersOfMagnitude += 1 ;
391+ this . _forwardTimeStep = this . _forwardTimeStep * 10n ;
392+ } else {
393+ throw new RangeError ( 'Could not find a sample to step forward to' ) ;
388394 }
389- this . timeCursor = TimePoint . fromCXXRTL ( response . samples . at ( 1 ) ! . time ) ;
390- break ;
391395 }
392396 }
393397 return this . timeCursor ;
You can’t perform that action at this time.
0 commit comments