Skip to content

Commit

Permalink
[nvim] add a timeit macro for C
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitmel committed Jan 25, 2023
1 parent 0e84eca commit 538cd8b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nvim/snippets/c.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ snippet main main function
$0
return 0;
}
snippet timeit measure execution time of a section of code
clock_t start_time${1:_test} = clock();
$0
clock_t elapsed_time${1:_test} = clock() - start_time${1:_test};
printf("%f\n", (double)elapsed_time${1:_test} / CLOCKS_PER_SEC);

0 comments on commit 538cd8b

Please sign in to comment.