Commit 3d49a8c9 authored by Pietro Fezzardi's avatar Pietro Fezzardi Committed by Alessandro Rubini

time-sim: simplified sim_time_get()

parent bd326eef
......@@ -44,15 +44,10 @@ int sim_fast_forward_ns(struct pp_globals *ppg, int64_t ff_ns)
static int sim_time_get(struct pp_instance *ppi, TimeInternal *t)
{
struct timespec ts;
ts.tv_nsec = SIM_PPI_ARCH(ppi)->time.current_ns %
t->nanoseconds = SIM_PPI_ARCH(ppi)->time.current_ns %
(long long)PP_NSEC_PER_SEC;
ts.tv_sec = (SIM_PPI_ARCH(ppi)->time.current_ns - ts.tv_nsec) /
t->seconds = (SIM_PPI_ARCH(ppi)->time.current_ns - t->nanoseconds) /
(long long)PP_NSEC_PER_SEC;
t->nanoseconds = ts.tv_nsec;
t->seconds = ts.tv_sec;
t->correct = 1;
if (!(pp_global_flags & PP_FLAG_NOTIMELOG))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment