小例子:
定义一个宏:
#define mysleep(_sec) fprintf(stderr,"sleep AT line:%d\n",__LINE__);sleep(_sec);fprintf(stderr,"after sleep\n");
然后,在程序中使用:
mysleep(10);
....
mysleep(10);
小例子:
定义一个宏:
#define mysleep(_sec) fprintf(stderr,"sleep AT line:%d\n",__LINE__);sleep(_sec);fprintf(stderr,"after sleep\n");
然后,在程序中使用:
mysleep(10);
....
mysleep(10);