Eina_Bool valid;
};
-#ifdef _WIN32
-LARGE_INTEGER _eina_counter_frequency;
-#endif
static char *
_eina_counter_asiprintf(char *base, int *position, const char *format, ...)
*/
/*============================================================================*
- * Global *
- *============================================================================*/
-
-/**
- * @internal
- * @brief Initialize the eina counter internal structure.
- *
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
- *
- * This function shuts down the counter module set up by
- * eina_counter_init(). It is called by eina_init().
- *
- * This function sets up the error module of Eina and only on Windows,
- * it initializes the high precision timer. It is also called
- * by eina_init(). It returns 0 on failure, otherwise it returns the
- * number of times it has already been called.
- *
- * @see eina_init()
- */
-Eina_Bool
-eina_counter_init(void)
-{
-#ifdef _WIN32
- if (!QueryPerformanceFrequency(&_eina_counter_frequency)) return EINA_FALSE;
-#endif /* _WIN2 */
- return EINA_TRUE;
-}
-
-/**
- * @internal
- * @brief Shut down the counter module.
- *
- * @return #EINA_TRUE on success, #EINA_FALSE on failure.
- *
- * This function shuts down the counter module set up by
- * eina_counter_init(). It is called by eina_shutdown().
- *
- * @see eina_shutdown()
- */
-Eina_Bool
-eina_counter_shutdown(void)
-{
- return EINA_TRUE;
-}
-
-/*============================================================================*
* API *
*============================================================================*/
#ifndef EINA_INLINE_PRIVATE_H_
# define EINA_INLINE_PRIVATE_H_
-#ifndef _WIN32
# include <time.h>
# include <sys/time.h>
-#else
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-# undef WIN32_LEAN_AND_MEAN
-#endif /* _WIN2 */
-#ifndef _WIN32
typedef struct timespec Eina_Nano_Time;
-#else
-typedef LARGE_INTEGER Eina_Nano_Time;
-
-extern LARGE_INTEGER _eina_counter_frequency;
-#endif
static inline int
_eina_time_get(Eina_Nano_Time *tp)
{
-#ifndef _WIN32
# if defined(CLOCK_PROCESS_CPUTIME_ID)
if (!clock_gettime(CLOCK_PROCESS_CPUTIME_ID, tp))
return 0;
tp->tv_nsec = tv.tv_usec * 1000L;
return 0;
-#else
- return QueryPerformanceCounter(tp);
-#endif /* _WIN2 */
}
static inline long int
{
long int r;
-#ifndef _WIN32
r = tp->tv_sec * 1000000000 + tp->tv_nsec;
-#else
- r = (long int)(((long long int)tp->QuadPart * 1000000000ll) /
- (long long int)_eina_counter_frequency.QuadPart);
-#endif
return r;
}
{
long int r;
-#ifndef _WIN32
r = (end->tv_sec - start->tv_sec) * 1000000000 +
end->tv_nsec - start->tv_nsec;
-#else
- r = (long int)(((long long int)(end->QuadPart - start->QuadPart)
- * 1000000000LL)
- / (long long int)_eina_counter_frequency.QuadPart);
-#endif
return r;
}
#include "eina_list.h"
#include "eina_matrixsparse.h"
#include "eina_array.h"
-#include "eina_counter.h"
#include "eina_benchmark.h"
#include "eina_magic.h"
#include "eina_rectangle.h"
S(ustringshare);
S(matrixsparse);
S(convert);
- S(counter);
S(benchmark);
S(rectangle);
S(strbuf);
S(ustringshare),
S(matrixsparse),
S(convert),
- S(counter),
S(benchmark),
S(rectangle),
S(strbuf),