Visual c++ 如何在windows中使用sys/time.h?

Visual c++ 如何在windows中使用sys/time.h?,visual-c++,timer,Visual C++,Timer,我正在使用MSVS2006,试图在我的程序中找到微秒级的时间。我试图在标头中调用sys/time.h,但此错误已编译 fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory Error executing cl.exe. 这是我的密码 #include<sys/time.h> #include<stdio.h> int main() { struc t

我正在使用MSVS2006,试图在我的程序中找到微秒级的时间。我试图在标头中调用sys/time.h,但此错误已编译

fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
Error executing cl.exe.
这是我的密码

#include<sys/time.h>
#include<stdio.h>
int main()
{
   struc timeval stop,start;
   gettimeofday(&start,NULL);

   /*my function here*/

   gettimeofday(&stop,NULL);
   printf("took %lu usec\n",stop.tv_usec-start.tv_usec);
}
#包括
#包括
int main()
{
struc timeval停止、启动;
gettimeofday(&start,NULL);
/*我在这里的职能*/
gettimeofday(&stop,NULL);
printf(“take%lu usec\n”,stop.tv\u usec-start.tv\u usec);
}

不幸的是,MSVC中没有sys\time.h头文件。相反,请尝试以下链接之一,以获得在Windows上编写此代码的帮助。mazaya jamil,你能分享一下哪个解决方案适合你吗?有sys\timeb.h