system_clock 2.0.0 copy "system_clock: ^2.0.0" to clipboard
system_clock: ^2.0.0 copied to clipboard

PlatformWindows

Flutter timekeeping facilities. Make it easy to get uptime, and elapsed time.

system_clock #

Pub

Flutter timekeeping facilities, powered by dart:ffi.

support platforms: AndroidiOSMacosWindowslinux

  • web is fallback to DateTime.now()

Getting Started #

import 'package:system_clock/system_clock.dart';

void main() {

  // Duration since boot, not counting time spent in deep sleep.
  println("system uptime: ${SystemClock.uptime()}");

  // Duration since boot, including time spent in sleep.
  println("system elapsed realtime: ${SystemClock.elapsedRealtime()}");
}

Refs #

https://android.googlesource.com/platform/frameworks/base/+/56a2301/core/java/android/os/SystemClock.java https://android.googlesource.com/platform/frameworks/base/+/master/core/jni/android_os_SystemClock.cpp https://android.googlesource.com/platform/frameworks/native/+/android-4.2.2_r1/include/utils/Timers.h https://android.googlesource.com/platform/system/core/+/master/libutils/Timers.cpp https://github.com/boyan01/system_clock/issues/3#issue-710700921

13
likes
140
points
7.07k
downloads

Publisher

verified publishersoit.tech

Weekly Downloads

Flutter timekeeping facilities. Make it easy to get uptime, and elapsed time.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

ffi, flutter, flutter_web_plugins

More

Packages that depend on system_clock