Unhardcode tick-to-ms conversion

Division by 100000.0 worked because `sysconf(_SC_CLK_TCK)` happened to be 100.

By unhardcoding:

1) It becomes more clear what this 100000.0 figure comes from.
2) It protects against bugs in the case `sysconf(_SC_CLK_TCK)` ever changes.
This commit is contained in:
Alexander Momchilov
2020-12-08 23:12:44 -05:00
committed by cgzones
parent f614b8a19f
commit 67ccd6b909
5 changed files with 35 additions and 15 deletions

View File

@ -34,7 +34,7 @@ bool Process_isThread(const Process* this);
void DarwinProcess_setFromKInfoProc(Process* proc, const struct kinfo_proc* ps, bool exists);
void DarwinProcess_setFromLibprocPidinfo(DarwinProcess* proc, DarwinProcessList* dpl);
void DarwinProcess_setFromLibprocPidinfo(DarwinProcess* proc, DarwinProcessList* dpl, double time_interval);
/*
* Scan threads for process state information.