I am writing a simple RTOS i have some tasks the works with different frequencies and priorities each task is represented by a function void f1(void),..etc. f1 is higher priority than f2 and it interrupt its execution and when finished f2 continues. the question is how to calculate the actual execution of f1 and f2 without pauses? second question? is their anyway to calculate the worst case execution time of a functions?