https://github.com/luke-rogerson/react-native-device-uptime
Get your iOS or Android device's uptime
https://github.com/luke-rogerson/react-native-device-uptime
android ios react-native typescript
Last synced: 12 months ago
JSON representation
Get your iOS or Android device's uptime
- Host: GitHub
- URL: https://github.com/luke-rogerson/react-native-device-uptime
- Owner: Luke-Rogerson
- License: mit
- Created: 2020-11-01T19:34:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-02T10:15:28.000Z (over 5 years ago)
- Last Synced: 2024-04-23T00:18:01.407Z (about 2 years ago)
- Topics: android, ios, react-native, typescript
- Language: Java
- Homepage: https://www.npmjs.com/package/react-native-device-uptime
- Size: 381 KB
- Stars: 4
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-device-uptime
A simple library to tell you your iOS or Android device's uptime (ie. the amount of time the system has been awake since the last time it was restarted).
On iOS, it wraps the [systemUptime](https://developer.apple.com/documentation/foundation/nsprocessinfo/1414553-systemuptime) property.
On Android, it uses the [elapsedRealtime](https://developer.android.com/reference/android/os/SystemClock#elapsedRealtime()) method.
## Installation
```sh
npm install react-native-device-uptime
```
## Usage
```js
import DeviceUptime from "react-native-device-uptime";
// ...
const uptime = await DeviceUptime.getUptime();
```
## Contributing
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
## License
MIT