hunk.code_window:   index: number = 0;
     sorted: boolean = false;
     frame: number = 0;
     maxFrames: number = 750;
     now() {
  
hunk.labels: keep keep keep keep add keep
hunk.after_edit:   protected static frameTimeFactor: number = 10;
  
hunk.file_path: src/schedulers/VirtualTimeScheduler.ts
hunk.type: add
file: import Subscription from '../Subscription';
  import ImmediateScheduler from './ImmediateScheduler';
  import Action from './Action';
  import ImmediateAction from './ImmediateAction';
  
  export default class FutureAction<T> extends ImmediateAction<T> {
  
    id: any;
    delay: number;
    
    constructor(public scheduler: ImmediateScheduler,
                public work: (x?: any) => Subscription<T> | void) {
      super(scheduler, work);
    }
  
    schedule(state?:any, delay:number = 0): Action {
      if (this.isUnsubscribed) {
        return this;
      }
      
      this.delay = delay;
      this.state = state;
      const id = this.id;
  
      if (id != null) {
        this.id = undefined;
        clearTimeout(id);
      }
  
      const scheduler = this.scheduler;
  
      this.id = setTimeout(() => {
        this.id = void 0;
        scheduler.actions.push(this);
        scheduler.flush();
      }, this.delay);
  
      return this;
    }
  
    unsubscribe() {
      const id = this.id;
      if (id != null) {
        this.id = void 0;
        clearTimeout(id);
      }
      super.unsubscribe();
    }
  }
  