Skip to content

Instantly share code, notes, and snippets.

@baobao
Last active February 4, 2019 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baobao/e59d55c1634fd9e12e4b320cfc13ff53 to your computer and use it in GitHub Desktop.
Save baobao/e59d55c1634fd9e12e4b320cfc13ff53 to your computer and use it in GitHub Desktop.
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