Created
November 30, 2011 01:41
-
-
Save naoh16/1407574 to your computer and use it in GitHub Desktop.
Matlab like "tic & toc" in C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <time.h> | |
static clock_t tictoc_start = 0; | |
void tic(void) { | |
s = clock(); | |
} | |
void toc(void) { | |
clock_t e = clock(); | |
fprintf(stderr, "経過時間は%f秒です。¥n", (double)(s-e)/CLOCKS_PER_SEC); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment