From 64657f82ec3a5e099e475282087ca14485553663 Mon Sep 17 00:00:00 2001 From: Mattrixwv Date: Fri, 8 Mar 2019 21:41:53 -0500 Subject: [PATCH] Updated the README to show usage for the stowatch --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 06fecf9..041ee18 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,16 @@ #myHelpers -These are some structures and functions that I have created that are not part of the standard library, but that I have found helpful to keep around. \ No newline at end of file +These are some structures and functions that I have created that are not part of the standard library, but that I have found helpful to keep around. + +#Stopwatch +This is a struct and set of functions that can be used to time portions of your code. +Usage example: + struct Stopwatch timer; + init(&timer); + start(&timer); + //Algorithm that you wish to time here + stop(&timer); + printf("It took %s to run this algorithm\n", getStr(&timer)); +You can get automatic resolutions of time with the getStr() function, but you can also get specific resolutions of time with the other get functions. +These are the other get functions: +getNano(), getMicro(), getMilli(), getSecond(), getMinute(), getHour() +getNano() returns a uint64_t, but the rest of the get functions return doubles \ No newline at end of file