timeSta represent the absolute time of simulation (current time)
dur represents the current duration of the phase. This value is returned by the function.
max represents the maximum duration available for the phase. This value is returned by the function.
min represents the minimum duration available for the phase. This value is returned by the function.
Output:
= 0: No error occurred.
< 0: Error