Skip to content

Commit

Permalink
Fix SimulationRuntime/c for OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
hkiel authored and OpenModelica-Hudson committed Mar 31, 2016
1 parent 8d51784 commit e57ec5c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions SimulationRuntime/c/util/rtclock.c
Expand Up @@ -402,6 +402,24 @@ double rt_ext_tp_tock(rtclock_t* tick_tp) {
return d - min_time;
}

void rt_ext_tp_tick_realtime(rtclock_t* tick_tp) {
*tick_tp = mach_absolute_time();
}

double rt_ext_tp_tock_realtime(rtclock_t* tick_tp) {
double d=0;
rtclock_t tock_tp = mach_absolute_time();
d = rtclock_value(tock_tp - *tick_tp);
return d;
}

int64_t rt_ext_tp_sync_nanosec(rtclock_t* tick_tp, uint64_t nsec)
{
int64_t res = 0;
throwStreamPrint(NULL, "%s not implemented for OSX", __FUNCTION__);
return res;
}

#else

/* CLOCK_MONOTONIC_RAW: since Linux 2.6.28 */
Expand Down

0 comments on commit e57ec5c

Please sign in to comment.