Game debugging

I'm working on a 2d game using sfml and my own "game engine". My problem is that every once in a while, at times I can't really predict, the game hangs for up to maybe half a second, and then continues. Does anyone know of any good method of hunting down a bug like that? I realize it's a hard question, but if anyone has any pointers it would be greatly appreciated :)

[EDIT](Another tricky question, anyone know what to do when your game segfaults. but runs just fine when running it in valgrind?)
Last edited on
Topic archived. No new replies allowed.