Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

Uptime

Improve this doc

This plugin provides the time spent in milliseconds since boot (uptime).

Repo: https://github.com/s1lviu/cordova-plugin-uptime

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-plugin-uptime
    $ npm install --save @ionic-native/[email protected]
    
  2. Add this plugin to your app's module

Supported platforms

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

API

Native

General