TuioTime TuioTime::operator+(TuioTime ttime) { long sec = seconds + ttime.getSeconds(); long usec = micro_seconds + ttime.getMicroseconds(); sec += usec/USEC_SECOND; usec = usec%USEC_SECOND; return TuioTime(sec,usec); }
TuioTime TuioTime::operator-(TuioTime ttime) { long sec = seconds - ttime.getSeconds(); long usec = micro_seconds - ttime.getMicroseconds(); if (usec<0) { usec += USEC_SECOND; sec--; } return TuioTime(sec,usec); }
void TuioTime::initSession() { TuioTime startTime = TuioTime::getSystemTime(); start_seconds = startTime.getSeconds(); start_micro_seconds = startTime.getMicroseconds(); }
bool TuioTime::operator!=(TuioTime ttime) { if ((seconds!=(long)ttime.getSeconds()) || (micro_seconds!=(long)ttime.getMicroseconds())) return true; else return false; }
void TuioTime::operator=(TuioTime ttime) { seconds = ttime.getSeconds(); micro_seconds = ttime.getMicroseconds(); }