2016-05-17 03:04:11 +12:00
|
|
|
#pragma once
|
|
|
|
|
2016-03-19 06:57:51 +13:00
|
|
|
#ifndef igs_resource_sleep_h
|
|
|
|
#define igs_resource_sleep_h
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
#include "igs_os_type.h" // DWORD
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
#ifndef IGS_RESOURCE_IFX_EXPORT
|
|
|
|
#define IGS_RESOURCE_IFX_EXPORT
|
|
|
|
#endif
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
namespace igs {
|
|
|
|
namespace resource {
|
2016-03-19 06:57:51 +13:00
|
|
|
/* 1second = 1,000milli_seconds(ミリ秒) */
|
|
|
|
IGS_RESOURCE_IFX_EXPORT void sleep_m(const DWORD milli_seconds);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#if !defined _WIN32
|
2016-06-15 18:43:10 +12:00
|
|
|
#include <ctime> // time_t, ::nanosleep()
|
|
|
|
namespace igs {
|
|
|
|
namespace resource {
|
2016-03-19 06:57:51 +13:00
|
|
|
/* unixではこちらがメイン,sleep_m()は内部でsleep_sn()を呼んでいる
|
|
|
|
1second=1,000milli_seconds=1,000,000micro_seconds=1,000,000,000nano_seconds
|
|
|
|
tv_sec(seconds)が負か、tv_nsec(nano_seconds)が0〜999,999,999範囲外、はエラー
|
2016-06-15 18:43:10 +12:00
|
|
|
*/
|
2016-03-19 06:57:51 +13:00
|
|
|
void sleep_sn(const time_t seconds, const long nano_seconds);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif /* !_WIN32 */
|
|
|
|
|
|
|
|
#endif /* !igs_resource_sleep_h */
|