millis(), equivalent function in 8051?
If you know the clock speed, you can tell the µC to do some idle task. One instruction will take \$ \frac{1}{F_{clk}} \$ to process. You can then write a assembly code (to have a maximum accuracy) to make the µC count his own clock \$ \frac{T_{ms}}{F_{clk} * 1000} \$ time. You can find some more detail on this website