I’m trying to measure how much time it takes a user to complete a certain activity in my app. Each user’s score will be compared against other users, and the lowest time wins.
The problem I’m running into is that I can’t find a way to break down time values into anything less than whole number seconds. For example, I can’t distinguish between 35.6 and 35.7 seconds - they both get rounded to 36.
I’m storing two date fields for the start and stop times, and then I’ve tried saving the difference between them as a date interval. But even though the documentation says that date intervals are stored as milliseconds, there does not seem to be a way to do math on these values manually. My only option is to round to the nearest whole number of seconds, which doesn’t work for my use case.
Can anybody advise on a plugin or workaround way of solving this? Thanks in advance for your help.