Skip to content

GameThread.Clock.CurrentTime is set at the end of a frame #6602

@Susko3

Description

@Susko3

I would expect the current time to be set when a new frame begins.

This doesn't matter in multi-threaded mode, as a new frame begins immediately after the previous ends.

But I think it may cause unnecessary animation jitter in single thread mode. Probably less visible if all threads have constant frame time. It's really hard to think about this "CurrentTime" which is not current, but in the past; but it's always in the past, so it kinda works out.

Code that is updating the clock at the end:

using (Monitor?.BeginCollecting(PerformanceCollectionType.Work))
OnNewFrame?.Invoke();
using (Monitor?.BeginCollecting(PerformanceCollectionType.Sleep))
Clock.ProcessFrame();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions