<commit_before>/**
 * @file   util_date.c
 * @author <NAME>
 * @date   08 Mar 2016
 * @brief  Date/time utility implementation.
 */

#include "util_date.h"
#if defined(__APPLE__)
    #include <mach/mach_time.h>
#endif
#include <sys/time.h>
#include <time.h>

/**
 * @brief Get the monotonic or realtime clock time.
 *
 * @param[in]     clock The clock type (monotonic or realtime).
 * @param[in,out] ts    A timespec structure to set with the current monotonic
 *                      time.
 *
 * @return True if the timespec was set with a valid time value.
 */
static bool utildate_gettptime(const enum util_date_clock clock,
                               struct timespec * const ts)
{
    bool retval = true;

    if ((clock > DATE_CLOCK_UNDEFINED) && (clock < DATE_CLOCK_UNSUPPORTED))
    {
#if defined(__APPLE__)
        struct timeval tv;<commit_msg>util_date: added copyright tag<commit_after>/**
 * @file      util_date.c
 * @brief     Date/time utility implementation.
 * @author    <NAME>
 * @date      08 Mar 2016
 * @copyright Copyright 2016 <NAME>. All rights reserved.
 *            This project is released under the MIT license.
 */

#include "util_date.h"
#if defined(__APPLE__)
    #include <mach/mach_time.h>
#endif
#include <sys/time.h>
#include <time.h>

/**
 * @brief Get the monotonic or realtime clock time.
 *
 * @param[in]     clock The clock type (monotonic or realtime).
 * @param[in,out] ts    A timespec structure to set with the current monotonic
 *                      time.
 *
 * @return True if the timespec was set with a valid time value.
 */
static bool utildate_gettptime(const enum util_date_clock clock,
                               struct timespec * const ts)
{
    bool retval = true;

    if ((clock > DATE_CLOCK_UNDEFINED) && (clock < DATE_CLOCK_UNSUPPORTED))
    {
#if defined(__APPLE__)
        struct timeval tv;
{'fraction_non_alphanumeric': 0.10359634997316157, 'fraction_numerical': 0.008588298443370907, 'mean_word_length': 2.6910891089108913, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '3342862', 'n_tokens_mistral': 611, 'n_tokens_neox': 573, 'n_words': 191}