Hi,
normally the time base for the MCU in all comes from an internal or external oscillator.
I do not know if you are using an eval board from an chip manufacturer or an custom board.
But in case that you are using a custom board I would check the oscillator unit.
Otherwise can you verify that your software settings for the system clock has not been change while the code was running?