Note that, for the specific example mentioned:
- DateTime.Now calls a system function with considerably higher cost that the boxing of an int (even taking into account the increased gen0 collection frequency associated with it).
- The precision of Dateime.Now is extremely low on windows platforms (10 -15 ms in most cases)
- Thus calling this function a lot is not terribly useful anyway, if you are doing it then it is likely you're doing something else wrong...
As such you should only worry about the internals of this if your profiling indicates it is a problem.
Since MS never bothered to fix it it would seem unlikely that this has ever cropped up as a problem for any customers.
Of more concern to you in the hidden allocation vein is more likely to be:
But again, all these (apart perhaps for the enumeration as key in dictionary which requires considerable effort to work around) should only be dealt with if you need to