# Checking spare time

What's the best way to check how much free time I have between the end of my Update procedure and the next Draw event?

I want to keep a careful track of how much time my code is taking up.

• Do you know when next Draw event is going to happen? Can you get current time within Update? What stops you from subtracting one from another and getting the result? – Kromster says support Monica Jan 21 '16 at 18:04
• I haven't tried anything yet. I'm new to Monogame, I'm using VB and I'm not sure I have full control over the Monogame layer. So I thought I'd ask before losing 3 days trying things that don't work. – MuntyScruntFundle Jan 21 '16 at 18:22
• Having been in software development for many years I have become all too woefully aware that software timers are usually not very accurate. This is why I asked the question. – MuntyScruntFundle Jan 21 '16 at 18:51
• This looks like XY problem. What you really asking is "How do I get precise time"? – Kromster says support Monica Jan 22 '16 at 5:29

Use a timer with a decent resolution (such as QueryPerformanceCounter on Windows).