Simulink Time Synchronization for Simulation and RTW
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
SyncTime.c
matlab2unix.m
test_synctime.mdl
unix2matlab.m

README.md

SyncTime Simulink function

Cross platform, for simulation and embedding

Produces epoch based timestamp and syncs the model to a given period

Usage

Specify dt as the period: if dt=0 just measure time otherwise sleeps a variable time to align with the dt

Internals

  • Linux: clock_gettime(CLOCK_REALTIME, &spec);
  • OSX: gettimeofday(&TV, NULL);
  • Windows: GetSystemTimeAsFileTime base + GetTickCount or QueryPerformanceCounter

TODO

Make Windows use GetSystemTimeAsFileTime always if needed