basic_timer 1.0.0

A basic timer implementation for benchmarking
Documentation
  • Coverage
  • 0%
    0 out of 9 items documented0 out of 4 items with examples
  • Size
  • Source code size: 2.94 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.33 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • TrentShailer

Basic Timer

About

This project is a basic implementation of a timer in rust made to be lightweight and accurate.

Usage

Initialize the timer with

let timer = Timer::new();

Then to get the time

let time = timer.get_time(duration_type: DurationType); This returns a u128

duration_type can be one of the following:

  • DurationType::Seconds
  • DurationType::Milliseconds
  • DurationType::Microseconds
  • DurationType::Nanoseconds

Example

use basic_timer::{Timer, DurationType};

fn main() {
	let timer = Timer::new();
	std::thread::sleep(std::time::Duration::new(5, 0));
	let time = timer.get_time(DurationType::Milliseconds);
}