Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of libMiMic by
NyLPC_cStopwatch.h
00001 /********************************************************************************* 00002 * PROJECT: MiMic 00003 * -------------------------------------------------------------------------------- 00004 * 00005 * This file is part of MiMic 00006 * Copyright (C)2011 Ryo Iizuka 00007 * 00008 * MiMic is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published 00010 * by the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00020 * 00021 * For further information please contact. 00022 * http://nyatla.jp/ 00023 * <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp> 00024 * 00025 *********************************************************************************/ 00026 #ifndef NYLPC_cStopwatch_H 00027 #define NYLPC_cStopwatch_H 00028 00029 #include "NyLPC_stdlib.h" 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif /* __cplusplus */ 00034 00035 /********************************************************************** 00036 * 00037 * NyLPC_TcStopwatch class 00038 * 00039 **********************************************************************/ 00040 00041 typedef struct NyLPC_TcStopwatch NyLPC_TcStopwatch_t; 00042 /** 00043 * このクラスは、経過時間を計算する関数を提供します。 00044 */ 00045 struct NyLPC_TcStopwatch 00046 { 00047 NyLPC_TUInt32 _tick; 00048 NyLPC_TUInt32 _ex_timeout; 00049 }; 00050 /** 00051 * 現在のtickCountを返します。 00052 */ 00053 NyLPC_TUInt32 NyLPC_cStopwatch_now(void); 00054 00055 void NyLPC_cStopwatch_initialize(NyLPC_TcStopwatch_t* i_inst); 00056 00057 00058 00059 #define NyLPC_cStopwatch_finalize(i) 00060 00061 void NyLPC_cStopwatch_set(NyLPC_TcStopwatch_t* i_inst,NyLPC_TUInt32 i_initial); 00062 00063 void NyLPC_cStopwatch_setNow(NyLPC_TcStopwatch_t* i_inst); 00064 00065 void NyLPC_cStopwatch_startExpire(NyLPC_TcStopwatch_t* i_inst,NyLPC_TUInt32 i_timeout); 00066 NyLPC_TUInt32 NyLPC_cStopwatch_elapseInMsec(const NyLPC_TcStopwatch_t* i_inst); 00067 /** 00068 * NyLPC_cStopwatch_startExpireで設定した時間を経過したかを返します。 00069 * @bug 00070 * NyLPC_cStopwatch_startExpireを実行しない状態で関数の戻り値は不定である。 00071 * 複数のスレッドで共有する場合は注意すること。 00072 */ 00073 NyLPC_TBool NyLPC_cStopwatch_isExpired(NyLPC_TcStopwatch_t* i_inst); 00074 00075 #ifdef __cplusplus 00076 } 00077 #endif /* __cplusplus */ 00078 00079 #endif
Generated on Tue Jul 12 2022 16:22:59 by
1.7.2
