code: public static EventStream<Long> animationTicks() {
          return new EventStreamBase<Long>() {
              private final AnimationTimer timer = new AnimationTimer() {
                  @Override
                  public void handle(long now) {
                      emit(now);
                  }
              };
  
              @Override
              protected Subscription observeInputs() {
                  timer.start();
                  return timer::stop;
              }
          };
      }
docs: Returns an event stream that emits a timestamp of the current frame in
  nanoseconds on every frame. The timestamp has the same meaning as the
  argument of the {@link AnimationTimer#handle(long)} method.