Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was using this in
fpswhen
below as well.I added this function back and tried
node = nothing
aftersend_value!
in core.jl. The fps node doesn't go away still.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spent some time looking, but I confess I don't really understand the design of
fps
well enough to be of any use.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The basic idea of
fps
is that it will fire at mostrate
times a second. If a signal depending on this fps signal takes longer than1/rate
seconds to update (for example drawing a complex Compose image), it will try to give you the best possible frame rate. The implementation schedules an update1/rate
seconds from the current update (during the current update) to accomplish this. The fps signal itself contains the time deltas between the previous update and the current one...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very helpful, thanks. So the user gets enough information to make the decision, for example, whether to show the next frame of the movie or to skip ahead to the frame that should have been scheduled at the current moment? That's very nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or compute the correct frame from a function such as
update(current_frame, dt) -> next_frame
. The animation would then just be:foldp(update, init_frame, fps(60))
, of course you are also free to usetime()
andmap
withfps
.