mirror of https://github.com/xzeldon/htop.git
Update timestamps for the special process scans at startup also
Resolves https://github.com/htop-dev/htop/issues/592
This commit is contained in:
parent
f3a37f9ef3
commit
367561175a
|
@ -241,14 +241,14 @@ static CommandLineSettings parseArguments(const char* program, int argc, char**
|
|||
return flags;
|
||||
}
|
||||
|
||||
static void millisleep(unsigned long millisec) {
|
||||
static void CommandLine_delay(ProcessList* pl, unsigned long millisec) {
|
||||
struct timespec req = {
|
||||
.tv_sec = 0,
|
||||
.tv_nsec = millisec * 1000000L
|
||||
};
|
||||
while(nanosleep(&req,&req)==-1) {
|
||||
while (nanosleep(&req, &req) == -1)
|
||||
continue;
|
||||
}
|
||||
Platform_gettime_realtime(&pl->realtime, &pl->realtimeMs);
|
||||
}
|
||||
|
||||
static void setCommFilter(State* state, char** commFilter) {
|
||||
|
@ -333,7 +333,7 @@ int CommandLine_run(const char* name, int argc, char** argv) {
|
|||
ScreenManager_add(scr, (Panel*) panel, -1);
|
||||
|
||||
ProcessList_scan(pl, false);
|
||||
millisleep(75);
|
||||
CommandLine_delay(pl, 75);
|
||||
ProcessList_scan(pl, false);
|
||||
|
||||
if (settings->allBranchesCollapsed)
|
||||
|
|
|
@ -35,9 +35,11 @@ ProcessList* ProcessList_init(ProcessList* this, const ObjectClass* klass, Users
|
|||
|
||||
// set later by platform-specific code
|
||||
this->cpuCount = 0;
|
||||
|
||||
this->monotonicMs = 0;
|
||||
|
||||
// always maintain valid realtime timestamps
|
||||
Platform_gettime_realtime(&this->realtime, &this->realtimeMs);
|
||||
|
||||
#ifdef HAVE_LIBHWLOC
|
||||
this->topologyOk = false;
|
||||
if (hwloc_topology_init(&this->topology) == 0) {
|
||||
|
|
Loading…
Reference in New Issue