#include
#include
#include
int main()
{
struct timeb tp;
struct tm * tm;
ftime (&tp);
tm = localtime (&( tp.time ));
printf("%02d:%02d:%02d:%03d\n", (tm->tm_hour), (tm->tm_min), (tm->tm_sec),(tp.millitm )); //?
}
这个是纳秒级的.
#include
#include
#include
#include
inline unsigned long long GetNTime()
{
__asm ("RDTSC");
}
int main()
{
long long time = GetNTime();
printf( "%qi\n",time );
return 0;
}
阅读(1891) | 评论(4) | 转发(0) |