Giter Site home page Giter Site logo

lamer's Introduction

Lamer

A header-only, high-precision latency measurement library, default nanosecond and up to cpu-clock-cycle, with customizable dump interface.

  • x86_64 Linux currently only.
  • C++ 17 required

Quick Start

#include "lamer.hpp"

using lamer::NanoMeasurer;

int main(int argc, char** argv)
{
    NanoMeasurer<> meur;

    meur.record("point a here!");
    std::cout << "hello world!" << std::endl;
    meur.record("point b!");

    meur.record();
    meur.record("point c hahah");
    
    meur.dump(std::cout);

    return 0;
}

// Example Output:
// 
// hello world!
// lame info (default dumper):
// precision: nanosec      sample: 4
// 
// 
// stamp(s.ns)             comment
// ------------------------------------
// 3.985534551             point a here !
// 3.985574928             point b!
// 3.985574989
// 3.985575019             point C hahah 

API Doc

0. Concept Overview

1. Struct & Class

Detector

Fn. Used to get timepoint.

Piece

Struct. A record of a timepoint with comment and mark.

Cache

Struct. A internal (stack) cached struct for pieces.

Measurer

Struct. A warpped structure that supplys function interfaces.

Dumper

Fn. Format data in cache to given output stream.

  • Specialize default dumper template to have customed format.

2. Macro

define the followings 'Declare Macro' before include statement to have extra compile time check.
( Better performance may be obtained. )

  • STRICT_MEMORY_ALIGN

3. Recommended Usuage

  • todo

4. Advise

  • nanosec, record cost 150ns / call (in my pc)
  • release compile, optmize, template specialize confilt

lamer's People

Contributors

guo-shiyu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.