Commit 3c0eb2b8 authored by Benjamin Summerton's avatar Benjamin Summerton

Working on README

updated LICENSE info and some header info for stopwatch.nim
parent 79f3a0d9
*
!*.txt
!*.md
!*.nim
!.gitignore
!stopwatch.nimble
*.sw*
nimcache/
tester
The MIT License (MIT)
Copyright (c) 2016 Benjamin N. Summerton, rbmz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# Stopwatch
Stopwatch
=========
This is a fork of rbmz's stopwatch: https://github.com/rbmz/stopwatch
It adds features such as multiple starting & stopping, lapping, and handy time
measurement conversino utility functions.
It is based off of Nim's builting `system/timers` module
Documentation
-------------
All of the functions should be documented in the file `stopwatch.nim`. At the
top of the file are
```nim
......
# File: stopwatch.nim
# Authors: Benjamin N. Summerton <define-private-public>
# rbmz
# License: MIT; See the file `LICENSE` for details.
# Description: A handly Stopwatch for timing code execution and other things.
include system/timers
from sequtils import foldl
......@@ -8,14 +15,13 @@ proc msecs*(nsecs: int64): int64 {.inline.}
proc secs*(nsecs: int64): float {.inline.}
# The stopwatch object
# The Stopwatch object
type
Stopwatch* = object
running: bool
startTicks: Nanos
laps: seq[Nanos]
# Basic stopwatch functionality
proc newStopwatch*(): Stopwatch
proc clone*(sw: var Stopwatch): Stopwatch
......@@ -45,7 +51,7 @@ proc totalMsecs*(sw: var Stopwatch): int64 {.inline.}
proc totalSecs*(sw: var Stopwatch): float {.inline.}
# Deprecations from the older stopwatch module
# Deprecations from the older Stopwatch module
{.deprecated: [clock: Stopwatch].}
{.deprecated: [nanoseconds: nsecs].}
{.deprecated: [seconds: secs].}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment