You are talking about "error" in code behaviour but don't tell what expected versus observed behaviour is.
My first observation, you are calling CheckFunc() without actual argument. I expect that inside CheckFunc() time_in_ms is treated as local variable, it's never read anywhere in the code, neither inside the function nor as return value.
Calling a function without defined arguments would be normally flagged as error unless the argument has a default value (an option provided by some compilers).