OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [runtime/] [go-now.c] - Blame information for rev 747

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// Copyright 2011 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4
 
5
#include <stddef.h>
6
#include <stdint.h>
7
#include <sys/time.h>
8
 
9
// Return current time.  This is the implementation of time.now().
10
 
11
struct time_now_ret
12
{
13
  int64_t sec;
14
  int32_t nsec;
15
};
16
 
17
struct time_now_ret now()
18
  __asm__ ("libgo_time.time.now")
19
  __attribute__ ((no_split_stack));
20
 
21
struct time_now_ret
22
now()
23
{
24
  struct timeval tv;
25
  struct time_now_ret ret;
26
 
27
  gettimeofday (&tv, NULL);
28
  ret.sec = tv.tv_sec;
29
  ret.nsec = tv.tv_usec * 1000;
30
  return ret;
31
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.