Skip to content

zhangyuang/timelog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

timelog

A simple timer library for logging time durations, similar to console.time in JavaScript.

Features

  • Create multiple named timers
  • Start, log, and end timers
  • Print timing results in milliseconds
  • Support for optional additional messages

Installation

Add the following line to your Cargo.toml file:

[dependencies]
timelog = "1.0.0"

Usage

use timelog::Timer;

fn main() {
    let mut timer = Timer::new();

    timer.time("fetch_data");

    let duration: f64 = timer.time_log("fetch_data", true);
    println!("fetch_data took {:.2}ms", duration);
}

Documentation

timelog

About

implement console.time api interface in Rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages