Home > other >  Server uptime in Ktor
Server uptime in Ktor

Time:11-20

How do I calculate server uptime in Ktor. In nodejs, there is process.uptime() which returns server uptime. I don't see an equivalent method in Ktor. Any suggestions ?

CodePudding user response:

Import:

import kotlin.time.toDuration
import kotlin.time.DurationUnit
import java.lang.management.ManagementFactory

You can try with enter image description here

  • Related