<commit_before>
#include <usual/time.h>

#include <string.h>

#include "test_common.h"


static void test_get_time(void *p)
{
	usec_t t, t2;
	usec_t ct, ct2;

	t = get_time_usec();
	ct = get_cached_time();

	usleep(USEC / 4);
	t2 = get_time_usec();
	tt_assert(t + USEC / 4 < t2);

	ct2 = get_cached_time();
	tt_assert(ct2 == ct);
	reset_time_cache();
	ct2 = get_cached_time();
	tt_assert(ct2 != ct);
end:;
}<commit_msg>test_time: allow exact usleep<commit_after>
#include <usual/time.h>

#include <string.h>

#include "test_common.h"


static void test_get_time(void *p)
{
	usec_t t, t2;
	usec_t ct, ct2;

	t = get_time_usec();
	ct = get_cached_time();

	usleep(USEC / 4);
	t2 = get_time_usec();
	tt_assert(t + USEC / 4 <= t2);

	ct2 = get_cached_time();
	tt_assert(ct2 == ct);
	reset_time_cache();
	ct2 = get_cached_time();
	tt_assert(ct2 != ct);
end:;
}
{'fraction_non_alphanumeric': 0.16608187134502925, 'fraction_numerical': 0.023391812865497075, 'mean_word_length': 4.487179487179487, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '6048457', 'n_tokens_mistral': 416, 'n_tokens_neox': 392, 'n_words': 81}