Skip to content

process: add `startTime` property

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

process

Description of change

This property allows us to check the starting time of the application, instead of just the uptime currently exposed by process.uptime().

This started as me thinking I'd just have to expose whatever was used for uptime, but as per libuv docs:

Don’t make assumptions about the starting point, you will only get disappointed.

So then I went down the path of getting the real timestamp. I have no idea if it's a bad idea to import ctime, but that's what googling led me to.

Warning: this is the first time in my life I've written C++, so, even in just 5 lines of code, I might have messed up.

Merge request reports

Loading