-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Replaced calls to DateTime.Now with DateTime.UtcNow to be locale agnostic #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
791444b
030fa6f
0587855
da92df9
b6c5d50
4266612
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,7 +164,7 @@ public unsafe void SetTreeScores(int idx, double[] scores) | |
|
|
||
| private LassoFit GetLassoFit(IChannel ch, int maxAllowedFeaturesPerModel) | ||
| { | ||
| DateTime startTime = DateTime.Now; | ||
| DateTime startTime = DateTime.UtcNow; | ||
|
|
||
| if (maxAllowedFeaturesPerModel < 0) | ||
| { | ||
|
|
@@ -450,7 +450,7 @@ private LassoFit GetLassoFit(IChannel ch, int maxAllowedFeaturesPerModel) | |
| // First lambda was infinity; fixing it | ||
| fit.Lambdas[0] = Math.Exp(2 * Math.Log(fit.Lambdas[1]) - Math.Log(fit.Lambdas[2])); | ||
|
|
||
| TimeSpan duration = DateTime.Now - startTime; | ||
| TimeSpan duration = DateTime.UtcNow - startTime; | ||
| ch.Info("Elapsed time for compression: {0}", duration); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This in particular is a bit weird and doesn't really have an effect I'd think. Probably harmless though, plus Honestly this code here ought to have been using stopwatch. #Closed
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right, this has no effect. I have added a stopwatch here instead as per your suggestion |
||
|
|
||
| return fit; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I don't know that this is correct, singe this
DateTimeZoneexists to encode a local time including a datetime. So I think that this change here might be inappropriate and is in fact introducing data corruption.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for pointing that out @TomFinley I will revert this change.