mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-05 13:30:00 -05:00
Clean up using gettimestamp()
Introduce a new local function gettimestamp() to get the current timestamp.
This commit is contained in:
parent
7379b061eb
commit
683c8bc4a2
8 changed files with 28 additions and 66 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue