<commit_before>#ifndef BCI_TIMER_C_INCLUDED
#define BCI_TIMER_C_INCLUDED

#include "timer.h"

void timer_Initialize(timer* timer)
{
	timer->firstCalled = nSysTime;
	timer->lastCalled = 0;
	timer->mark = 0;
	timer->hardMark = -1;
	timer->repeatMark = -1;
}

long timer_GetDT(timer* timer)
{
	long dt = nSysTime - timer->lastCalled;
	timer->lastCalled = nSysTime;
	return dt;
}

long timer_GetStartingTime(timer* timer)
{
	return timer->firstCalled;
}

long timer_GetDTFromStart(timer* timer)
{
	return nSysTime - timer->firstCalled;
}

void timer_PlaceMarker(timer *timer)
{
	timer->mark = nSysTime;
}

void timer_PlaceHardMarker(timer *timer)
{
	if (timer->hardMark == -1)
	{
		timer->hardMark = nSysTime;
	}
}

void timer_ClearHardMarker(timer *timer)
{
	timer->hardMark = -1;
}

long timer_GetDTFromMarker(timer *timer)
{
	return nSysTime - timer->mark;
}

long timer_GetDTFromHardMarker(timer *timer)
{
	return nSysTime - timer->hardMark;
}

bool timer_Repeat(timer *timer, long timeMs)
{
	if (timer->repeatMark == -1)
	{
		timer->repeatMark = nSysTime;
	}

	if (nSysTime - timer->repeatMark >= timeMs)
	{
		timer->repeatMark = -1;
		return true;
	}

	return false;
}

#endif //BCI_TIMER_C_INCLUDED
<commit_msg>Bug fixes<commit_after>#ifndef BCI_TIMER_C_INCLUDED
#define BCI_TIMER_C_INCLUDED

#include "timer.h"

void timer_Initialize(timer* timer)
{
	timer->firstCalled = nSysTime;
	timer->lastCalled = 0;
	timer->mark = 0;
	timer->hardMark = -1;
	timer->repeatMark = -1;
}

long timer_GetDT(timer* timer)
{
	long dt = nSysTime - timer->lastCalled;
	timer->lastCalled = nSysTime;
	return dt;
}

long timer_GetStartingTime(timer* timer)
{
	return timer->firstCalled;
}

long timer_GetDTFromStart(timer* timer)
{
	return nSysTime - timer->firstCalled;
}

void timer_PlaceMarker(timer *timer)
{
	timer->mark = nSysTime;
}

void timer_PlaceHardMarker(timer *timer)
{
	if (timer->hardMark == -1)
	{
		timer->hardMark = nSysTime;
	}
}

void timer_ClearHardMarker(timer *timer)
{
	timer->hardMark = -1;
}

long timer_GetDTFromMarker(timer *timer)
{
	return timer->mark == -1 ? 0 : nSysTime - timer->mark;
}

long timer_GetDTFromHardMarker(timer *timer)
{
	return timer->hardMark == -1 ? 0 : nSysTime - timer->hardMark;
}

bool timer_Repeat(timer *timer, long timeMs)
{
	if (timer->repeatMark == -1)
	{
		timer->repeatMark = nSysTime;
	}

	if (nSysTime - timer->repeatMark >= timeMs)
	{
		timer->repeatMark = -1;
		return true;
	}

	return false;
}

#endif //BCI_TIMER_C_INCLUDED

{'fraction_non_alphanumeric': 0.13570274636510501, 'fraction_numerical': 0.008077544426494346, 'mean_word_length': 4.455947136563877, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 45, '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': '5859368', 'n_tokens_mistral': 993, 'n_tokens_neox': 984, 'n_words': 193}