Last active
February 4, 2019 19:09
-
-
Save baobao/e59d55c1634fd9e12e4b320cfc13ff53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Windows.Forms; | |
using SlimDX.Windows; | |
class Program | |
{ | |
// エントリーポイント | |
static void Main() | |
{ | |
using (Game game = new Game()) | |
{ | |
game.Run(); | |
} | |
} | |
} | |
class Game : Form | |
{ | |
System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); | |
public void Run() | |
{ | |
sw.Start(); | |
MessagePump.Run(this, Draw); | |
} | |
private void Draw() | |
{ | |
// 毎フレーム経過時間を調べるために経過時間を出力 | |
System.Console.WriteLine(sw.ElapsedMilliseconds); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment