A game framework written with osu! in mind.
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2// See the LICENCE file in the repository root for full licence text.
3
4namespace osu.Framework.Timing
5{
6 /// <summary>
7 /// A clock which will only update its current time when a frame process is triggered.
8 /// Useful for keeping a consistent time state across an individual update.
9 /// </summary>
10 public interface IFrameBasedClock : IClock
11 {
12 /// <summary>
13 /// Elapsed time since last frame in milliseconds.
14 /// </summary>
15 double ElapsedFrameTime { get; }
16
17 /// <summary>
18 /// A moving average representation of the frames per second of this clock.
19 /// Do not use this for any timing purposes (use <see cref="ElapsedFrameTime"/> instead).
20 /// </summary>
21 double FramesPerSecond { get; }
22
23 FrameTimeInfo TimeInfo { get; }
24
25 /// <summary>
26 /// Processes one frame. Generally should be run once per update loop.
27 /// </summary>
28 void ProcessFrame();
29 }
30}