Here is one possible implementation of a millisecond timer in C using time.h and ts.tv_nsec
Proof of concept: Timer Source code
A simpler, more compliant version can be found in repository.
GOOGLE SHEET MANIPULATION
Spreadsheet link>> Translation:
Result: