I apologize in advance if I have grammar mistakes - English is not my strong side. :)
I am trying to create a code in C# which has 2 variables that represents time: The first contains hours, and the second contains minutes.
My question is simple - what datatype should I use for those variables? on one hand, I should use byte
, because hours and minutes are between 0
and 255
, but on the other hand - I have read that the CPU works better with int
. So which one should I use?
Here is the answer I have read which compares between int
and byte
from the perspective of CPU performance: Why should I use int instead of a byte or short in C#
Thank you for your assistance!