GetTickCount- System 'uptime' in milliseconds implementation
I had some issues with the clock(); function - i.e. not being able to reset it / reconfigure it on clock change, so I wrote a new function that uses the LPC1768 System Tick Timer to count ticks. It's a pretty handy function for benchmarking, debouncing interrupts, etc. You might know this as millis() from ardunio. The counter is a 32-bit unsigned integer, so it'll reset - "rollover" after 50 days automatically.
You need to init the counter first by calling GetTickCount_Start(). The tick counter has a resolution of 10ms as is in milliseconds.
Starts the counter.
Stops the counter.
Resets the counter.
unsigned int GetTickCount(void)
Returns the current value of the counter.
You need to log in to post a comment