#include <sys/time.h> 
#include <stdio.h> 
int main(){
 struct timeval tv1, tv2;
 gettimeofday(&tv1,NULL);
 usleep(1000);
 gettimeofday(&tv2,NULL);
 printf("Time Cost is %d ms\n", (tv1.tv_sec - tv2.tv_sec) * 1000 );
}
2011年8月4日 星期四
How to calculate function time cost in C
2011年8月3日 星期三
SQLite Compile
今天在Compile sqlite要用configure時遇到一些錯誤  
11/10/18補充:
-DSQLITE_DISABLE_LFS
#error Sorry... uClibc was built without large file support!
checking host system type... Invalid configuration `cr16-uclinux': machine `cr16 ' not recognized 
configure: error: /bin/sh ./config.sub cr16-uclinux failed 
 copy /usr/share/libtool/config/config.guess and config.sub to your working folder can fix this problem 
And... 
#error It appears you have defined _FILE_OFFSET_BITS=64. Unfortunately, uClibc was built without large file support enabled. 
#error Sorry... uClibc was built without large file support! 
只要在Makefile加上下面兩個flags就可以過了
-DSQLITE_OMIT_LOAD_EXTENSION
-DSQLITE_OMIT_COMPLETE
11/10/18補充:
-DSQLITE_DISABLE_LFS
#error Sorry... uClibc was built without large file support!