Skip to content
This repository was archived by the owner on Jun 18, 2021. It is now read-only.

Conversation

@hhellyer
Copy link
Contributor

Obtain the start time via as a time_t via time() so we can do a
simple uptime calculation later on via difftime().

This should resolve issue #83.

Obtain the start time via as a time_t via time() so we can do a
simple uptime calculation later on via difftime().
localtime_r(&time_val.tv_sec, &loadtime_tm_struct);
#endif
load_time = mktime(&loadtime_tm_struct);
time(&load_time);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it matter that loadtime_tm_struct and load_time may be different after this change?

@rnchamberlain
Copy link
Contributor

Converting the Windows SYSTEMTIME structure to the tm struct required by mktime() is a pain and would need quite a bit of extra code. @richardlau is right that by getting the time again we could have ticked over a second, but I don't think it matters here. We use load_time for the average CPU consumption, which is an approximation anyway.

LGTM

@rnchamberlain
Copy link
Contributor

Landing this shortly

rnchamberlain pushed a commit that referenced this pull request May 4, 2017
Obtain the start time via as a time_t via time() so we can do a
simple uptime calculation later on via difftime().

PR-URL: #85
Reviewed-By: Richard Chamberlain <richard_chamberlain@uk.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
@rnchamberlain
Copy link
Contributor

Landed as 1b62e31

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants