Skip to content

Changes

Summary

  1. Remove call of localtime (details)
Commit 42ca6cca52dee9eba75b17435652b21bf8eb1988 by modelica
Remove call of localtime

There is a race condition between localtime and ftime/gettimeofday in ModelicaInternal_getTime. In case ftime/gettimeofday is called at a very new second, this can lead to a inaccuracy of (almost) 1 second for the calculated time.

Using gmtime, there is no need to call localtime. Instead the struct tm can be directly computed from the obtained timebuffer and timezone information.
The file was modified Modelica/Resources/C-Sources/ModelicaInternal.c (diff)