The value of 'oldtime' should be set to the current millisecs time after the 'millisecs - oldtime' line above rather than before it.
It's also a good idea to grab the value of the 'MilliSecs()' timer and stick it in a Global at the start of your main loop so you're not making repetitive calls to 'MilliSecs()'.
eg.
Global current_time
Global oldtime
;-----
current_time = MilliSecs()
time_elapsed = current_time - oldtime
oldtime = current_time
It's also a good idea to grab the value of the 'MilliSecs()' timer and stick it in a Global at the start of your main loop so you're not making repetitive calls to 'MilliSecs()'.
eg.
Global current_time
Global oldtime
;-----
current_time = MilliSecs()
time_elapsed = current_time - oldtime
oldtime = current_time