Uptime
This plugin return the device uptime, without sleep time.
Repo: https://github.com/s1lviu/cordova-plugin-uptime
Installation
- Install the Cordova and Ionic Native plugins:
$ '' $ npm install --save @ionic-native/uptime
- Add this plugin to your app's module
Supported platforms
- Android
Usage
import { Uptime } from '@ionic-native/uptime';
constructor(private uptime: Uptime) { }
...
this.uptime.getUptime()
.then((uptime: any) => console.log(uptime))
.catch((error: any) => console.log(error));
Instance Members
getUptime()
This function return system uptime
Returns: Promise<string>
Returns a promise that return the uptime in milliseconds