Skip to content

Instantly share code, notes, and snippets.

@poychang
Created September 28, 2022 02:48
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 poychang/0719af7496fc3868877b9dccbbd033fa to your computer and use it in GitHub Desktop.
Save poychang/0719af7496fc3868877b9dccbbd033fa to your computer and use it in GitHub Desktop.
[LINQPad - Benchmark 效能測試樣板] 簡單驗證執行效能
#LINQPad optimize+
BenchmarkRunner.Run<BenchmarkJob>();
[SimpleJob(RunStrategy.ColdStart, targetCount: 10)]
[MemoryDiagnoser]
public class BenchmarkJob
{
[Benchmark]
public void Method1()
{
Thread.Sleep(100);
}
[Benchmark]
public void Method2()
{
Thread.Sleep(200);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment