Sorry but I'm having a hard time seeing the ambiguity. Are the words 'begin' and 'end' really not explicit enough?
No it's not that, but with the example you kind of suggest, that it will capture the whole time spent on each frame, which is to a large extend true, but you'll miss the few nano-/milliseconds that is spent between begin/end.
while(true)
{
clock.beginFrame();
// This gets recorded
clock.endFrame();
} // The time spent here, freeing resources or whatever doesn't get counted
I know it doesn't really matter, since the time spent there is and should be very, very low, but I just wanted to point it out. It's something one can easily miss.
A possible fix would be to write something like this:
while(true)
{
clock.beginFrame();
{
// Do something
} // Stuff gets cleaned up here
clock.endFrame();
}
Now the only thing that can still take longer than 1-2 CPU cycle is the function which feeds the while loop's check.
Again it doesn't really matter, but one should just be aware.