mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-30 20:06:56 -05:00
Use monotonic clock for thermal sampling intervals and model time axis
This commit is contained in:
parent
9ec2457147
commit
305d1bce36
3 changed files with 9 additions and 7 deletions
|
|
@ -5839,13 +5839,15 @@ static void state_progress_graph(struct snapraid_state* state, struct snapraid_i
|
|||
int state_progress(struct snapraid_state* state, struct snapraid_io* io, block_off_t blockpos, block_off_t countpos, block_off_t countmax, data_off_t countsize)
|
||||
{
|
||||
time_t now;
|
||||
uint64_t thermal_now;
|
||||
int pred;
|
||||
|
||||
now = time(0);
|
||||
thermal_now = os_tick_sec();
|
||||
|
||||
/* thermal measure */
|
||||
if (now > state->thermal_latest + THERMAL_PERIOD_SECONDS || state->opt.fake_device) {
|
||||
state->thermal_latest = now;
|
||||
if (thermal_now > state->thermal_latest + THERMAL_PERIOD_SECONDS || state->opt.fake_device) {
|
||||
state->thermal_latest = thermal_now;
|
||||
state_thermal(state, now);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue