Optimizing alternatives to DateTime.Now

前端 未结 4 1149
隐瞒了意图╮
隐瞒了意图╮ 2020-12-29 04:36

A colleague and I are going back and forth on this issue and I\'m hoping to get some outside opinions as to whether or not my proposed solution is a good idea.

First

4条回答
  •  春和景丽
    2020-12-29 05:14

    To answer in reverse order:

    2) I cannot think of a faster way.

    1) It would be worth checking if there are any framework improvements in the pipeline like they have just announced for System.IO

    It's hard to be sure about safety but it's something that is crying out for a lot of unit tests. Daylight savings comes to mind. The System one is obviously very battle hardened while yours is not.

提交回复
热议问题