<commit_before>/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include <stdlib.h>

#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif

#ifdef HAVE_EVIL
# include <Evil.h> /* for gettimeofday */
#endif

#include "Ecore.h"
#include "ecore_private.h"



/* FIXME: clock_gettime() is an option... */

/**
 * Retrieves the current system time as a floating point value in seconds.
 *
 * Also see ecore_loop_time_get().
 *
 * @return  The number of seconds since 12.00AM 1st January 1970.
 * @ingroup Ecore_Time_Group
 */
EAPI double
ecore_time_get(void)
{
#ifdef HAVE_GETTIMEOFDAY
   struct timeval      timev;

   gettimeofday(&timev, NULL);
   return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000);
#else
# error "Your platform isn't supported yet"
#endif
}

double _ecore_loop_time = -1.0;

/**
 * Retrieves the time at which the last loop stopped waiting for timeouts or events
 *
 * This gets the time (since Jan 1st, 1970, 12:00AM) that the main loop ceased<commit_msg>use evil_time_get() instead of gettimeofday() when using Evil. It's more precise and involves fewer computations<commit_after>/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include <stdlib.h>

#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif

#ifdef HAVE_EVIL
# include <Evil.h>
#endif

#include "Ecore.h"
#include "ecore_private.h"



/* FIXME: clock_gettime() is an option... */

/**
 * Retrieves the current system time as a floating point value in seconds.
 *
 * Also see ecore_loop_time_get().
 *
 * @return  The number of seconds since 12.00AM 1st January 1970.
 * @ingroup Ecore_Time_Group
 */
EAPI double
ecore_time_get(void)
{
#ifdef HAVE_EVIL
  return evil_time_get();
#else
# ifdef HAVE_GETTIMEOFDAY
   struct timeval      timev;

   gettimeofday(&timev, NULL);
   return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000);
# else
#  error "Your platform isn't supported yet"
# endif
#endif
}

double _ecore_loop_time = -1.0;

/**
 * Retrieves the time at which the last loop stopped waiting for timeouts or events
 *
 * This gets the time (since Jan 1st, 1970, 12:00AM) that the main loop ceased
{'fraction_non_alphanumeric': 0.12096774193548387, 'fraction_numerical': 0.03136200716845878, 'mean_word_length': 4.168981481481482, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4481987', 'n_tokens_mistral': 877, 'n_tokens_neox': 816, 'n_words': 237}