This clock is defined in "/util/times.c" and can be accessed through two functions calls:
EXPORT void start_clock(char *s) EXPORT void stop_clock(char *s)Each of these functions are turned on only by debugging on the word "CLOCK".
CLOCK stringwhile stop_clock prints the cpu time it took:
CLOCK cpu_timeSo, a typical code fragment would be:
EXPORT void my_function(void)
{
start_clock("my_function");
STUFF;
stop_clock("my_function");
}
As a result, if a function starts, but does not stop, you know clean_up
was called in there,
or in the functions it calls.The printing of CLOCK information is formatted in a nested manner, which makes spotting the absence of a stop very easy.
Copyright 1997 This article may be redistributed to other individuals for noncommercial use, provided that the entire text, all HTML codes, and this copyright notice remains intact and unaltered in any way. This article may not be resold, reprinted, or redistributed in whole or in part for compensation of any kind without prior written permission of the author.