-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.h
More file actions
23 lines (16 loc) · 742 Bytes
/
debug.h
File metadata and controls
23 lines (16 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <time.h>
#define DEBUGSTART(s) \
{FILE *fd; fd=fopen("debug","w"); \
fprintf(fd,s); fclose(fd);}
#define DEBUG(s) \
{FILE *fd; fd=fopen("debug","a"); \
fprintf(fd,s); fclose(fd);}
#define CLOCK(x,s) \
{clock_t start = clock(); \
{x;} \
clock_t finish = clock(); \
double duration = (double)(finish - start) / CLOCKS_PER_SEC; \
FILE *fd; fd=fopen("debug","a"); \
fprintf(fd,"ExecTime [%s] : %5.3f\n",s,duration); fclose(fd);}
long mem_free();
void mem_print(float n);