190 |
ostringstream command; |
ostringstream command; |
191 |
command << "wget -O " << tempfile << " --tries=1 --timeout=15 -o /dev/null \"" << url << "\""; |
command << "wget -O " << tempfile << " --tries=1 --timeout=15 -o /dev/null \"" << url << "\""; |
192 |
int res = system( command.str().c_str() ); |
int res = system( command.str().c_str() ); |
193 |
if (res) |
|
194 |
|
if (res>0) |
195 |
|
{ |
196 |
throw std::runtime_error("Command time out"); |
throw std::runtime_error("Command time out"); |
197 |
|
} |
198 |
|
|
199 |
ifstream in( tempfile.c_str() ); |
ifstream in( tempfile.c_str() ); |
200 |
|
|
280 |
|
|
281 |
int mTimeDiff(const timeval& then, const timeval& now) |
int mTimeDiff(const timeval& then, const timeval& now) |
282 |
{ |
{ |
283 |
return uTimeDiff(then,now) / 1000; |
return ( (now.tv_sec - then.tv_sec)*1000) + |
284 |
|
((now.tv_usec-then.tv_usec)/1000); |
285 |
} |
} |
286 |
|
|
287 |
} |
} |