File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,18 @@ namespace s3d
168
168
[[nodiscard]]
169
169
double usF () const ;
170
170
171
+ // / @brief 残り時間を [秒] で返します。小数点以下は切り上げられます。
172
+ // / @remark 例えば、残り 2.1 秒の場合は 3 を返します
173
+ // / @return 残り時間 [秒]
174
+ [[nodiscard]]
175
+ int32 s_ceil () const ;
176
+
177
+ // / @brief 残り時間を [秒] で返します。小数点以下は切り上げられます。
178
+ // / @remark 例えば、残り 2.1 秒の場合は 3 を返します
179
+ // / @return 残り時間 [秒]
180
+ [[nodiscard]]
181
+ int64 s64_ceil () const ;
182
+
171
183
// / @brief 設定されているカウントダウン時間を返します。
172
184
// / @return 設定されているカウントダウン時間
173
185
[[nodiscard]]
Original file line number Diff line number Diff line change @@ -220,6 +220,16 @@ namespace s3d
220
220
return static_cast <double >(us ());
221
221
}
222
222
223
+ int32 Timer::s_ceil () const
224
+ {
225
+ return static_cast <int32>(s64_ceil ());
226
+ }
227
+
228
+ int64 Timer::s64_ceil () const
229
+ {
230
+ return static_cast <int64>(std::ceil (usF () / (1000LL * 1000LL )));
231
+ }
232
+
223
233
Duration Timer::duration () const
224
234
{
225
235
return SecondsF{ m_durationMicrosec / static_cast <double >(1000LL * 1000LL ) };
You can’t perform that action at this time.
0 commit comments