Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

cordova-plugin-uptime

0.1.1 • Public • Published

cordova-plugin-uptime

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

Installation

$ ionic cordova plugin add cordova-plugin-uptime
$ npm install --save @ionic-native/uptime

Supported Platforms

  • Android
  • iOS

Usage

Ionic Framework 2+ - TypeScript

 import { Uptime } from '@ionic-native/uptime';  
  
 constructor(private uptime: Uptime) { }  
 
 ...  
  
 this.uptime.getUptime(includeDeepSleep)  
   .then((uptime) => console.log(uptime))  
   .catch((error) => console.log(error));  

ES5 usage:

Uptime.getUptime(includeDeepSleep,
    function(uptime) { 
        console.log('Uptime (ms): ', uptime);
    },
    function(err) {  
        console.log(err);
    }
);

The includeDeepSleep is a boolean parameter. If it's set to true, the returned uptime will include the total uptime (including device sleeping time), otherwise, will be the up time, considering clock stops when system enters deep sleep (CPU off, display dark, device waiting for external input), but is not affected by clock scaling, idle, or other power saving mechanisms.

Author

This plugin is made with ❤️ by Silviu Stroe

install

npm i cordova-plugin-uptime

Downloadsweekly downloads

56

version

0.1.1

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability