#include <bits/stdc++.h>
#include <sys/time.h>
#include "testlib.h"
using namespace std;
#define int long long
struct timeval time;
调用部分:
gettimeofday(&time, NULL);
double end = time.tv_sec * 1000 + time.tv_usec / 1000;
double used = end - start;
报错信息:
/tmp/compiler_tcbdoi8o/src:6:16: 错误:‘timeval time’ redeclared as different kind of entity
6 | struct timeval time;
| ^~~~