- Added support for accessing the exe file management functions from scripts
- Fixed a bug in hmdata.c - Fixed an issue with tempoerature writing through RemObjects in mesure - Added auxiliary reflections to tasub - Make maximize use soft motor positions
This commit is contained in:
16
statistics.c
16
statistics.c
@ -13,9 +13,9 @@ struct Statistics {
|
||||
Statistics *next;
|
||||
};
|
||||
|
||||
static Statistics *current;
|
||||
static Statistics *current = NULL;
|
||||
static tv_t last, lastStat;
|
||||
static Statistics *idle = NULL, *list;
|
||||
static Statistics *idle = NULL, *list = NULL;
|
||||
static int init = 1;
|
||||
/*-----------------------------------------------------------------------*/
|
||||
tv_t timeDif(tv_t t1, tv_t t2) {
|
||||
@ -128,7 +128,9 @@ Statistics *StatisticsBegin(Statistics *stat) {
|
||||
|
||||
res = current;
|
||||
gettimeofday(&now, 0);
|
||||
timeAdd(¤t->tim, timeDif(last, now));
|
||||
if(current != NULL){
|
||||
timeAdd(¤t->tim, timeDif(last, now));
|
||||
}
|
||||
last = now;
|
||||
current = stat;
|
||||
stat->last = now;
|
||||
@ -142,10 +144,12 @@ void StatisticsEnd(Statistics *stat) {
|
||||
gettimeofday(&now, 0);
|
||||
timeAdd(¤t->tim, timeDif(last, now));
|
||||
last = now;
|
||||
if (current->last.tv_sec >= 0) {
|
||||
timeAdd(¤t->total, timeDif(current->last, now));
|
||||
if(current != NULL){
|
||||
if (current->last.tv_sec >= 0) {
|
||||
timeAdd(¤t->total, timeDif(current->last, now));
|
||||
}
|
||||
current->last.tv_sec = -1;
|
||||
}
|
||||
current->last.tv_sec = -1;
|
||||
current = stat;
|
||||
}
|
||||
/*-----------------------------------------------------------------------*/
|
||||
|
Reference in New Issue
Block a user