Giter Club home page Giter Club logo

drstopwatch's Introduction

DRStopwatch

DRStopwatch provides a simpler API to measure times from applications written in C/C++ to applications for iOS and Mac OS X. This project has two main goals: be simple and be precise.

Note Support for Linux and Apple hardware (iOS and Mac OS X)

Installation

Just drag DRStopwatch folder to your project.

Usage

C/C++

To use DRStopwatch you only need to declare a structure Stopwatch and use the following API.

void sw_start(Stopwatch *s);
void sw_stop(Stopwatch *s);
double sw_get_elapsed_milliseconds(Stopwatch *s);
double sw_get_elapsed_seconds(Stopwatch *s);

Warning On Linux you may need to link with the librt library using -lrt.

Objective-C

The support for Objective-C is made of a wrapper around the C/C++ API, the class DRStopwatch. This class provides the following API.

+ (instancetype)stopwatch;
+ (instancetype)stopwatchStartingNow;
- (id)init;
- (void)start;
- (void)stop;
- (double)elapsedTime:(DRTimeOption)option;

Note DRTimeOption can take the values kElapsedTimeSeconds and kElapsedTimeMilliseconds to specified the time unit.

Licence

MIT License (c) David Rodrigues

drstopwatch's People

Contributors

dmcrodrigues avatar

Stargazers

 avatar  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.