17
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

#ifとConditional

Posted at

デバッグ用の関数は#ifで中身を全部囲うよりも、
デバッグ用の関数にConditional属性をつけた方が、
関数呼び出し自体がされなくなる分パフォーマンスがいいらしい。

private void Hoge()
{
#if DEBUG
    Console.WriteLine("Hoge");
#endif
}

よりも

[Conditional("DEBUG")]
private void Hoge()
{
    Console.WriteLine("Hoge");
}
17
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?