<commit_before>/* libhs - public domain
   <NAME> <<EMAIL>>
   https://koromix.dev/libhs

   This software is in the public domain. Where that dedication is not
   recognized, you are granted a perpetual, irrevocable license to copy,
   distribute, and modify this file as you see fit.

   See the LICENSE file for more details. */

#include "common_priv.h"
#include <mach/mach_time.h>
#include <sys/select.h>
#include <sys/utsname.h>
#include "platform.h"

uint64_t hs_millis(void)
{
    static mach_timebase_info_data_t tb;
    if (!tb.numer)
        mach_timebase_info(&tb);

    return (uint64_t)mach_absolute_time() * tb.numer / tb.denom / 1000000;
}

void hs_delay(unsigned int ms)
{
    struct timespec t, rem;<commit_msg>Fix implicit nanosleep() declaration on macOS<commit_after>/* libhs - public domain
   <NAME> <<EMAIL>>
   https://koromix.dev/libhs

   This software is in the public domain. Where that dedication is not
   recognized, you are granted a perpetual, irrevocable license to copy,
   distribute, and modify this file as you see fit.

   See the LICENSE file for more details. */

#include "common_priv.h"
#include <mach/mach_time.h>
#include <sys/select.h>
#include <sys/utsname.h>
#include <time.h>
#include "platform.h"

uint64_t hs_millis(void)
{
    static mach_timebase_info_data_t tb;
    if (!tb.numer)
        mach_timebase_info(&tb);

    return (uint64_t)mach_absolute_time() * tb.numer / tb.denom / 1000000;
}

void hs_delay(unsigned int ms)
{
    struct timespec t, rem;
{'fraction_non_alphanumeric': 0.10610079575596817, 'fraction_numerical': 0.014588859416445624, 'mean_word_length': 3.7602523659305995, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 2, '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': '4597383', 'n_tokens_mistral': 544, 'n_tokens_neox': 516, 'n_words': 158}