MCPcopy Create free account
hub / github.com/KDAB/GammaRay / appStartTime

Function appStartTime

plugins/signalmonitor/relativeclock.cpp:25–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23using namespace GammaRay;
24
25static qint64 appStartTime()
26{
27#ifdef Q_OS_LINUX
28
29 // On Linux the application start time can be read by procfs.
30 const QString &self = QStringLiteral("/proc/%1").arg(qApp->applicationPid());
31 return QFileInfo(self).lastModified().toMSecsSinceEpoch();
32
33#else // !Q_OS_LINUX
34
35 // On other platforms this is a rough estimation if called early.
36 return QDateTime::currentMSecsSinceEpoch();
37
38#endif // !Q_OS_LINUX
39}
40
41const RelativeClock *RelativeClock::sinceAppStart()
42{

Callers 1

sinceAppStartMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected