Skip to content

Commit

Permalink
process: linted code
Browse files Browse the repository at this point in the history
  • Loading branch information
ShogunPanda committed Jan 7, 2025
1 parent 5d77130 commit 1fdd439
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/node_process_methods.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ static void ThreadCPUUsage(const FunctionCallbackInfo<Value>& args) {
double* fields = static_cast<double*>(ab->Data());

#if defined(_WIN32)
// On Windows, GetCurrentThread will return the current thread pseudo-handler, which is then
// used in GetThreadTimes to retrieve the current thread timing information.
// On Windows, GetCurrentThread will return the current thread pseudo-handler,
// which is then used in GetThreadTimes to retrieve the current thread timing
// information.
// The documentation is accessible here:
// https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentthread
// https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getthreadtimes
Expand Down Expand Up @@ -189,11 +190,11 @@ static void ThreadCPUUsage(const FunctionCallbackInfo<Value>& args) {
fields[0] =
MICROS_PER_SEC * usage.user_time.seconds + usage.user_time.microseconds;
fields[1] = MICROS_PER_SEC * usage.system_time.seconds +
usage.system_time.microseconds;
usage.system_time.microseconds;
#else
// On other Unix / Linux, getrusage(2) with RUSAGE_THREAD is used to get
// the current thread CPU usage.
// The documentation is accessible by running man getrusage.
// On other Unix / Linux, getrusage(2) with RUSAGE_THREAD is used to get
// the current thread CPU usage.
// The documentation is accessible by running man getrusage.
struct rusage usage;

if (getrusage(RUSAGE_THREAD, &usage) == -1) {
Expand Down

0 comments on commit 1fdd439

Please sign in to comment.