int handle = 0;
uint16_t fnum;
bool newhandle = false;
- struct timeval tp_start;
+ struct timespec tp_start;
uint16 attr;
SMB_OFF_T size;
off_t start = 0;
return 1;
}
- GetTimeOfDay(&tp_start);
+ clock_gettime_mono(&tp_start);
status = cli_open(targetcli, targetname, O_RDONLY, DENY_NONE, &fnum);
if (!NT_STATUS_IS_OK(status)) {
}
{
- struct timeval tp_end;
+ struct timespec tp_end;
int this_time;
- GetTimeOfDay(&tp_end);
- this_time =
- (tp_end.tv_sec - tp_start.tv_sec)*1000 +
- (tp_end.tv_usec - tp_start.tv_usec)/1000;
+ clock_gettime_mono(&tp_end);
+ this_time = TspecDiff(&tp_start,&tp_end);
get_total_time_ms += this_time;
get_total_size += nread;
XFILE *f;
SMB_OFF_T start = 0;
int rc = 0;
- struct timeval tp_start;
+ struct timespec tp_start;
struct cli_state *targetcli;
char *targetname = NULL;
struct push_state state;
return 1;
}
- GetTimeOfDay(&tp_start);
+ clock_gettime_mono(&tp_start);
if (reput) {
status = cli_open(targetcli, targetname, O_RDWR|O_CREAT, DENY_NONE, &fnum);
}
{
- struct timeval tp_end;
+ struct timespec tp_end;
int this_time;
- GetTimeOfDay(&tp_end);
- this_time =
- (tp_end.tv_sec - tp_start.tv_sec)*1000 +
- (tp_end.tv_usec - tp_start.tv_usec)/1000;
+ clock_gettime_mono(&tp_end);
+ this_time = TspecDiff(&tp_start,&tp_end);
put_total_time_ms += this_time;
put_total_size += state.nread;
fd_set fds;
struct timeval timeout;
static time_t last_t;
+ struct timespec now;
time_t t;
- t = time(NULL);
+ clock_gettime_mono(&now);
+ t = now.tv_sec;
if (t - last_t < 5)
return;