Skip to content

Instantly share code, notes, and snippets.

@naoh16
Created November 30, 2011 01:41
Show Gist options
  • Save naoh16/1407574 to your computer and use it in GitHub Desktop.
Save naoh16/1407574 to your computer and use it in GitHub Desktop.
Matlab like "tic & toc" in C
#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