Click here to Skip to main content
15,893,161 members
Articles / Programming Languages / C#

Which Works Faster- Null Coalescing Operator or GetValueOrDefault or Conditional Operator

Rate me:
Please Sign up or sign in to vote.
5.00/5 (7 votes)
27 Sep 2015Ms-PL7 min read 22.1K   5  
Benchmark, which works faster for getting the default value for a nullable type, Null Coalescing Operator or GetValueOrDefault or Conditional Operator.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
CEO Automate The Planet
Bulgaria Bulgaria
CTO and Co-founder of Automate The Planet Ltd, inventor of BELLATRIX Test Automation Framework, author of "Design Patterns for High-Quality Automated Tests: High-Quality Test Attributes and Best Practices" in C# and Java. Nowadays, he leads a team of passionate engineers helping companies succeed with their test automation. Additionally, he consults companies and leads automated testing trainings, writes books, and gives conference talks. You can find him on LinkedIn every day.

Comments and Discussions