enh(Foundation): add Poco::Process::timesMicroseconds()

This commit is contained in:
Günter Obiltschnig
2024-11-21 08:50:49 +01:00
parent 21f93e3e6a
commit cecccf7b74
8 changed files with 58 additions and 5 deletions

View File

@@ -94,6 +94,10 @@ public:
/// Returns the number of seconds spent by the
/// current process in user and kernel mode.
static void timesMicroseconds(Poco::Int64& userTime, Poco::Int64& kernelTime);
/// Returns the number of microseconds spent by the
/// current process in user and kernel mode.
static ProcessHandle launch(const std::string& command, const Args& args, int options = 0);
/// Creates a new process for the given command and returns
/// a ProcessHandle of the new process. The given arguments are
@@ -268,6 +272,12 @@ inline void Process::times(long& userTime, long& kernelTime)
}
inline void Process::timesMicroseconds(Poco::Int64& userTime, Poco::Int64& kernelTime)
{
ProcessImpl::timesMicrosecondsImpl(userTime, kernelTime);
}
} // namespace Poco

View File

@@ -56,6 +56,7 @@ public:
static PIDImpl idImpl();
static void timesImpl(long& userTime, long& kernelTime);
static void timesMicrosecondsImpl(Poco::Int64& userTime, Poco::Int64& kernelTime);
static ProcessHandleImpl* launchImpl(
const std::string& command,
const ArgsImpl& args,

View File

@@ -57,6 +57,7 @@ public:
static PIDImpl idImpl();
static void timesImpl(long& userTime, long& kernelTime);
static void timesMicrosecondsImpl(Poco::Int64& userTime, Poco::Int64& kernelTime);
static ProcessHandleImpl* launchImpl(
const std::string& command,
const ArgsImpl& args,

View File

@@ -61,6 +61,7 @@ public:
static PIDImpl idImpl();
static void timesImpl(long& userTime, long& kernelTime);
static void timesMicrosecondsImpl(Poco::Int64& userTime, Poco::Int64& kernelTime);
static ProcessHandleImpl* launchImpl(
const std::string& command,
const ArgsImpl& args,