cordova-plugin-uptime
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "cordova-plugin-uptime", | ||
"version": "0.1.1", | ||
"description": "This plugin return the time spent in milliseconds since boot (uptime).", | ||
"version": "0.1.2", | ||
"description": "A Cordova plugin to retrieve the system uptime in milliseconds since boot.", | ||
"cordova": { | ||
@@ -30,3 +30,3 @@ "id": "cordova-plugin-uptime", | ||
"author": "Silviu Stroe", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"bugs": { | ||
@@ -33,0 +33,0 @@ "url": "https://github.com/s1lviu/cordova-plugin-uptime/issues" |
@@ -1,12 +0,10 @@ | ||
# cordova-plugin-uptime | ||
This plugin provides the time spent in milliseconds since boot (uptime). | ||
This plugin provides the system uptime in milliseconds since boot, allowing developers to track how long a device has been running. This can be particularly useful for monitoring, diagnostics, or adding uptime information within an application. | ||
## Installation | ||
``` | ||
```bash | ||
$ ionic cordova plugin add cordova-plugin-uptime | ||
$ npm install --save @ionic-native/uptime | ||
``` | ||
@@ -16,4 +14,4 @@ | ||
- Android | ||
- iOS | ||
- Android | ||
- iOS | ||
@@ -24,13 +22,12 @@ ## 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)); | ||
```typescript | ||
import { Uptime } from '@ionic-native/uptime'; | ||
constructor(private uptime: Uptime) { } | ||
// ... | ||
this.uptime.getUptime(includeDeepSleep) | ||
.then((uptime) => console.log('Uptime (ms): ', uptime)) | ||
.catch((error) => console.log('Error: ', error)); | ||
``` | ||
@@ -40,3 +37,3 @@ | ||
``` | ||
```javascript | ||
Uptime.getUptime(includeDeepSleep, | ||
@@ -47,11 +44,19 @@ function(uptime) { | ||
function(err) { | ||
console.log(err); | ||
console.log('Error: ', 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](https://developer.android.com/reference/android/os/SystemClock.html#uptimeMillis%28%29) (CPU off, display dark, device waiting for external input), but is not affected by clock scaling, idle, or other power saving mechanisms. | ||
The `includeDeepSleep` is a boolean parameter. If set to true, the returned uptime includes the total uptime (including device sleeping time). Otherwise, it will be the uptime considering clock stops when the 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. | ||
## Contributing | ||
If you would like to contribute to this plugin, please feel free to submit a pull request or open an issue on our [GitHub repository](https://github.com/s1lviu/cordova-plugin-uptime). | ||
## Author | ||
This plugin is made with :heart: by [Silviu Stroe](https://silviu-s.com/) | ||
This plugin is made with :heart: by [Silviu Stroe](https://silviu-s.com/) | ||
## License | ||
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
43
59
13210
8