X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Flibfirm%2Ftiming.h;h=282e4ece11223f808caf4a97334da9e4bbbd7eaa;hb=07c77ebb4b165865ecdfc45a048ac55dea14d84e;hp=70e609c9c0bc7c1f0bd829db2e0371fd760caa38;hpb=f6d087a414f0541ada64323431ae6444f32fddbf;p=libfirm diff --git a/include/libfirm/timing.h b/include/libfirm/timing.h index 70e609c9c..282e4ece1 100644 --- a/include/libfirm/timing.h +++ b/include/libfirm/timing.h @@ -20,14 +20,21 @@ /** * @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 #include -typedef struct _ir_timer_t ir_timer_t; +#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; /** * Switch to real-time scheduling. @@ -36,57 +43,58 @@ typedef struct _ir_timer_t ir_timer_t; * @note You could need special user privileges. * @return 0 on success, else UNIX error code. */ -int ir_timer_enter_high_priority(void); +FIRM_API int ir_timer_enter_high_priority(void); /** * Leave the high priority mode. * @see ir_timer_enter_high_priority() * @return 0 on success, else UNIX error code. */ -int ir_timer_leave_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. */ -size_t ir_get_heap_used_bytes(void); +FIRM_API size_t ir_get_heap_used_bytes(void); /** * Create a new timer * @return The timer. + * @see #ir_timer_t */ -ir_timer_t *ir_timer_new(void); +FIRM_API ir_timer_t *ir_timer_new(void); /** * free memory occupied by a timer * @param timer The timer */ -void ir_timer_free(ir_timer_t *timer); +FIRM_API void ir_timer_free(ir_timer_t *timer); /** * Start a timer. * @param timer The timer. */ -void ir_timer_start(ir_timer_t *timer); +FIRM_API void ir_timer_start(ir_timer_t *timer); /** * Reset a timer and start it. * @param timer The timer. */ -void ir_timer_reset_and_start(ir_timer_t *timer); +FIRM_API void ir_timer_reset_and_start(ir_timer_t *timer); /** * Reset a timer. * @param timer The timer. */ -void ir_timer_reset(ir_timer_t *timer); +FIRM_API void ir_timer_reset(ir_timer_t *timer); /** * Stop a timer. * Stopping a stopped timer has no effect. * @param timer The timer. */ -void ir_timer_stop(ir_timer_t *timer); +FIRM_API void ir_timer_stop(ir_timer_t *timer); /** * Push a timer of the timer stack. This automatically @@ -95,41 +103,29 @@ 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. */ -int ir_timer_push(ir_timer_t *timer); +FIRM_API int 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 */ -ir_timer_t *ir_timer_pop(void); +FIRM_API ir_timer_t *ir_timer_pop(void); /** - * 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. */ -unsigned long ir_timer_elapsed_msec(const ir_timer_t *timer); +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. */ -unsigned long ir_timer_elapsed_usec(const ir_timer_t *timer); +FIRM_API unsigned long ir_timer_elapsed_usec(const ir_timer_t *timer); -/** - * Get name of given timer. - * @param timer The timer. - * @return The name of the timer. - */ -const char *ir_timer_get_name(const ir_timer_t *timer); - -/** - * Get description of given timer. - * @param timer The timer. - * @return The description of the timer. - */ -const char *ir_timer_get_description(const ir_timer_t *timer); +#include "end.h" #endif