X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Flibfirm%2Ftiming.h;h=14f70b3720485eb327ae50df28ad6e664ccfcf1a;hb=ce29d67e4cf75e435dd50b15a294a07a3b3e6309;hp=163e91b354d7656642b85e5c73a95d36c470d001;hpb=ab182d4b9ed44239ab3ff1d08b2f8e14a3699ccf;p=libfirm diff --git a/include/libfirm/timing.h b/include/libfirm/timing.h index 163e91b35..14f70b372 100644 --- a/include/libfirm/timing.h +++ b/include/libfirm/timing.h @@ -20,7 +20,6 @@ /** * @file * @brief platform neutral timing utilities - * @version $Id: tv.h 17143 2008-01-02 20:56:33Z beck $ */ #ifndef FIRM_TIMING_H #define FIRM_TIMING_H @@ -29,6 +28,12 @@ #include "begin.h" +/** + * A timer + * + * A timer can be started/stopped multiple times and measures the (wallclock) + * time spent between start and stop calls. + */ typedef struct ir_timer_t ir_timer_t; /** @@ -48,7 +53,7 @@ FIRM_API int ir_timer_enter_high_priority(void); FIRM_API int ir_timer_leave_high_priority(void); /** - * Get the amount of bytes allocated on the heap. + * Returns the amount of bytes allocated on the heap. * @return The number of bytes allocated on the heap. */ FIRM_API size_t ir_get_heap_used_bytes(void); @@ -56,6 +61,7 @@ FIRM_API size_t ir_get_heap_used_bytes(void); /** * Create a new timer * @return The timer. + * @see #ir_timer_t */ FIRM_API ir_timer_t *ir_timer_new(void); @@ -90,6 +96,11 @@ FIRM_API void ir_timer_reset(ir_timer_t *timer); */ FIRM_API void ir_timer_stop(ir_timer_t *timer); +/** + * Set currently running timer as parent to @p timer + */ +FIRM_API void ir_timer_init_parent(ir_timer_t *timer); + /** * Push a timer of the timer stack. This automatically * stop the previous timer on tos and start the new one. @@ -97,29 +108,34 @@ FIRM_API void ir_timer_stop(ir_timer_t *timer); * @param timer The timer to push on stack. * @return non-zero on succes, zero if the timer is already on the stack. */ -FIRM_API int ir_timer_push(ir_timer_t *timer); +FIRM_API void ir_timer_push(ir_timer_t *timer); /** * Pop the current timer. This automatically stops it and * start the timer that is now on the stack. * @return the popped timer */ -FIRM_API ir_timer_t *ir_timer_pop(void); +FIRM_API void ir_timer_pop(ir_timer_t *timer); /** - * Get the number of milliseconds, the timer has elapsed. + * Returns the number of milliseconds, the timer has elapsed. * @param timer The timer. * @return The number of milliseconds the timer is (was) running. */ FIRM_API unsigned long ir_timer_elapsed_msec(const ir_timer_t *timer); /** - * Get the number of microseconds, the timer has elapsed. + * Returns the number of microseconds, the timer has elapsed. * @param timer The timer. * @return The number of milliseconds the timer is (was) running. */ FIRM_API unsigned long ir_timer_elapsed_usec(const ir_timer_t *timer); +/** + * Returns the number of seconds, the timer has elapsed. + */ +FIRM_API double ir_timer_elapsed_sec(const ir_timer_t *timer); + #include "end.h" #endif