Skip to content

AndroidClockModel

vasilakis edited this page Apr 21, 2011 · 2 revisions

AndroidClockModel class handles unix timeval struct and can return the struct's data in seconds, milliseconds or microseconds. Thsese are the methods the class contains:

//returns the total microseconds of time struct argument
uint32_t microseconds( time_t time );

//returns the total milliseconds of time struct argument
uint32_t milliseconds( time_t time );

//returns the total seconds of time struct argument
uint32_t seconds( time_t time );

All methods return an uint32_t integer and accept a time_t struct as an argument. The time_t struct is actually a unix timeval struct since there is a typedef in the class:

typedef struct timeval time_t;

This way can create a time_t struct:

AndroidClockModel::time_t tv;

The file is at cbox/android_wiselib/androidConcepts/clockConcept/clock.h.