Clean up using gettimestamp()

Introduce a new local function gettimestamp() to get the current timestamp.
This commit is contained in:
Takashi Iwai 2007-11-21 12:19:43 +01:00
parent 7379b061eb
commit 683c8bc4a2
8 changed files with 28 additions and 66 deletions

View file

@ -838,3 +838,13 @@ typedef union snd_tmp_double {
double d;
int64_t l;
} snd_tmp_double_t;
/* get the current timestamp */
static inline void gettimestamp(snd_htimestamp_t *tstamp)
{
struct timeval tv;
gettimeofday(&tv, 0);
tstamp->tv_sec = tv.tv_sec;
tstamp->tv_nsec = tv.tv_usec * 1000L;
}