X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=src%2Fapps_plugin.c;h=818f447bb98aa60fc321be45da88f28d48faa88d;hb=b1dfe19b4f139a7e213d078dab8dd430040851b2;hp=4d05ab05888924763cbc126298f6618537c41c82;hpb=4f70e286e364acf64a5cea254652938b4a81f392;p=netdata.git diff --git a/src/apps_plugin.c b/src/apps_plugin.c index 4d05ab05..818f447b 100644 --- a/src/apps_plugin.c +++ b/src/apps_plugin.c @@ -2387,12 +2387,6 @@ void parse_args(int argc, char **argv) } } -unsigned long long sutime() { - struct timeval now; - gettimeofday(&now, NULL); - return now.tv_sec * 1000000ULL + now.tv_usec; -} - int main(int argc, char **argv) { // debug_flags = D_PROCFILE; @@ -2456,11 +2450,11 @@ int main(int argc, char **argv) for(;1; counter++) { #ifndef PROFILING_MODE // delay until it is our time to run - while((sunow = sutime()) < sunext) + while((sunow = timems()) < sunext) usleep((useconds_t)(sunext - sunow)); // find the next time we need to run - while(sutime() > sunext) + while(timems() > sunext) sunext += update_every * 1000000ULL; #endif /* PROFILING_MODE */