Actually that is not at all a bad way to do the job. That is, in fact, the entire idea behind a
whole branch of profiler design called "sampling profilers" or sometimes "statistical profilers"! For example, Intel's own "VTune" profiler is exactly this kind of profiler.
For more information:
http://en.wikipedia.org/wiki/Prof...gramming%29#Statistical_profilers
- Casey