#ifdef WIN32
#else
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include <conio.h>
#include <stdio.h>
#include <sys/timeb.h>
#include <time.h>
#include <conio.h>
#include <unistd.h>
#endif
int main()
{
long time_ms;
#ifdef WIN32
struct _timeb timebuffer;
_ftime( &timebuffer );
time_ms = (long)timebuffer.time * 1000 + (long)timebuffer.millitm;
printf("Windows timing %ld", time_ms);
#else
struct timeval t1;
struct timezone tz;
gettimeofday(&t1, &tz);
time_ms = (t1.tv_sec) * 1000 + t1.tv_usec / 1000;
printf("Other timing %ld", time_ms);
#endif
// return time_ms;
}`
这是完整代码的一部分,但是当我单独运行时遇到相同的错误,无法找到解决方案。我附上了错误屏幕截图