# The best way to make a precise stopwatch (0.001 of second) for a racing game?

I made a collider and something like that (this is just an idea, not a perfect copy-paste from my code):

``````void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Player"))
{
time = Time.time - startPointTime;
}
}
``````

It works, but it gives me results with only 0.02 of second precision, for example 4.660 or 5.080.

I know that I can do `time += Time.deltaTime;` in Update function, but I tested this and in that case a lower framerate gives a better time for the player.

What is the best approach for that problem? I was thinking about something like higher frequency of `OnTriggerEnter` checks (but only for that one collider), but I have no idea how to do that or even is it possible or good practice.

I guess you can increase the physics iterations, But imho 1 thousands of a second is overkill, 1 hundreth should be fine. But up to you.

Use Time.RealTimeSinceStartup; It will return the number of seconds the game has been running to 5 decimal places, You can use that with some basic maths to make a timer, I use it for repreating timing events

A Possible solution is simply to scale everything by a ten factor, and then dividing the result showed con screen by that same factor, you should be carefull about gravity thoe, cause that one will stay at the same constant value

Problem is:

Any process that repeats itself within a very short timespan will eat all your processing cycles and not precisely doing the interesting part of your game. In other words: which part is more important? The race car simulation or the lap timekeeping?