File: time-current.c

package info (click to toggle)
jack-tools 20101210-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 504 kB
  • sloc: ansic: 4,678; makefile: 122; lisp: 48; sh: 16
file content (25 lines) | stat: -rw-r--r-- 477 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*  time-current.c - (c) rohan drape, 2005-2006 */

#include <stdlib.h>

#include <sys/time.h>

#include "float.h"
#include "time-timeval.h"
#include "time-current.h"

/* Get the current time as a UTC double precision value. */

f64 current_time_as_utc_real(void) 
{
  struct timeval current;
  gettimeofday(&current, NULL); 
  return timeval_to_real(current);
}
  
struct timeval current_time_as_utc_timeval(void)
{
  struct timeval tv;
  gettimeofday(&tv, 0);
  return tv;
}