Uptime
This plugin provides the time spent in milliseconds since boot (uptime).
Repo: https://github.com/s1lviu/cordova-plugin-uptime
Installation
- Install the Cordova and Ionic Native plugins:
$ ionic cordova plugin add cordova-plugin-uptime $ npm install --save @ionic-native/uptime@4
- Add this plugin to your app's module
Supported platforms
- Android
- iOS
Usage
import { Uptime } from '@ionic-native/uptime';
constructor(private uptime: Uptime) { }
...
this.uptime.getUptime(includeDeepSleep)
.then(uptime => console.log(uptime))
.catch(error => console.log(error));
Instance Members
getUptime(includeDeepSleep)
This function return system uptime
Param | Type | Details |
---|---|---|
includeDeepSleep |
boolean
|
Set to true to include system deep sleep |
Returns: Promise<string>
Returns a promise that return the uptime in milliseconds