This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
rc2007-soccer/source/Concept/Framework/tools.h
2007-02-17 00:35:01 +00:00

39 lines
618 B
C

#ifndef _TOOLS_H
#define _TOOLS_H
#include <stdlib.h>
#ifndef new
void* operator new(size_t sz);
void operator delete(void* p);
#endif
inline void sleep(int sec)
{
for (int s=0; s<sec; s++) {
for (long int i=0; i<1405678; i++) {
asm volatile("nop");
}
}
};
inline void msleep(int msec)
{
for (int s=0; s<msec; s++) {
for (long int i=0; i<1405; i++) {
asm volatile("nop");
}
}
};
inline void usleep(int usec)
{
usec *= 100;
for (int s=0; s<usec; s++) {
for (long int i=0; i<1405; i++) {
asm volatile("nop");
}
}
};
#endif