统一跨平台时间函数接口。
This commit is contained in:
@@ -19,7 +19,7 @@ void Energy::judgeShootInWorld() {
|
||||
// is_predicting = false;
|
||||
// is_guessing = true;
|
||||
// start_guess = true;
|
||||
// gettimeofday(&time_start_guess, NULL);
|
||||
// getsystime(time_start_guess);
|
||||
LOGM(STR_CTR(WORD_LIGHT_RED, "Start Guessing!"));
|
||||
} else
|
||||
shoot = 2;
|
||||
@@ -35,7 +35,7 @@ void Energy::judgeShootInGimbal() {
|
||||
// is_predicting = false;
|
||||
// is_guessing = true;
|
||||
// start_guess = true;
|
||||
// gettimeofday(&time_start_guess, NULL);
|
||||
// getsystime(time_start_guess);
|
||||
// LOGM(STR_CTR(WORD_LIGHT_RED, "Start Guessing!"));
|
||||
} else
|
||||
shoot = 2;
|
||||
|
||||
@@ -14,8 +14,7 @@ using namespace cv;
|
||||
// 此函数用于判断guess模式是否超时
|
||||
// ---------------------------------------------------------------------------------------------------------------------
|
||||
bool Energy::isGuessingTimeout() {
|
||||
timeval cur_time;
|
||||
gettimeofday(&cur_time, NULL);
|
||||
return (cur_time.tv_sec - time_start_guess.tv_sec) * 1000.0 +
|
||||
(cur_time.tv_usec - time_start_guess.tv_usec) / 1000.0 > 1000;
|
||||
systime cur_time;
|
||||
getsystime(cur_time);
|
||||
return getTimeIntervalms(cur_time, time_start_guess) > 1000;
|
||||
};
|
||||
@@ -4,8 +4,7 @@
|
||||
#include "energy/energy.h"
|
||||
#include "log.h"
|
||||
#include "config/setconfig.h"
|
||||
#include "options/options.h"
|
||||
#include <sys/time.h>
|
||||
#include "options.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
Reference in New Issue
Block a user