2020-08-04 00:14:35 +08:00
|
|
|
// STIMER V2.0
|
|
|
|
// Copyright (c) 2014-2020 x-studio - All Rights Reserved
|
2021-12-25 10:04:45 +08:00
|
|
|
//
|
2020-08-04 00:14:35 +08:00
|
|
|
#ifndef _SIMPLE_TIMER_H_
|
|
|
|
#define _SIMPLE_TIMER_H_
|
|
|
|
|
2023-06-11 13:08:08 +08:00
|
|
|
#include "base/Macros.h"
|
2020-08-04 00:14:35 +08:00
|
|
|
#include <functional>
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_BEGIN
|
2021-12-25 10:04:45 +08:00
|
|
|
namespace stimer
|
|
|
|
{
|
|
|
|
typedef void* TIMER_ID;
|
|
|
|
typedef std::function<void(void)> vcallback_t;
|
2022-07-15 19:17:01 +08:00
|
|
|
AX_DLL TIMER_ID loop(unsigned int n, float interval, vcallback_t callback, bool bNative = true);
|
|
|
|
AX_DLL TIMER_ID delay(float delay, vcallback_t callback, bool bNative = true);
|
|
|
|
AX_DLL void kill(TIMER_ID timerId, bool bNative = true);
|
|
|
|
AX_DLL void killAll(bool bNative = true);
|
2021-12-25 10:04:45 +08:00
|
|
|
} // namespace stimer
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_END
|
2020-08-04 00:14:35 +08:00
|
|
|
|
|
|
|
#endif
|