Measure execution time of events

I am making a graphically very simple multiplayer card game. But when I make an input, everything happens too much later. Like 1-2 seconds later usually. I have no idea what could cause this, but to search for the problem I am looking for a tool that could help me measure the time between calling an event, and the end of it.
Any ideas?