As one example of the present invention a method for constructing a real-time system is disclosed. The real-time system includes at least one module, each module having at least one mode. The method comprises: defining a mode period for each mode for a repeated execution of the respective mode by the corresponding module; for each mode, defining one or more synchronous tasks to be executed by the real-time system, whereby each synchronous task is associated with a logical execution time during which the task execution has to be completed; defining an integer number of time-slots for the mode period of each mode; assigning to each task at least one time slot during which the task is to be executed.