Difference between revisions of "RTC Elapsed ms"

From WikiPrizm
Jump to navigationJump to search
(Created page with "{{syscall | name = RTC_Elapsed_ms | header = fxcg/rtc.h | index = 0x02C2 | signature = int RTC_Elapsed_ms(int start_value, int duration_in_ms) | synopsis = Checks whether a gi...")
 
 
(One intermediate revision by the same user not shown)
Line 8: Line 8:
 
* '''duration_in_ms''' - period in milliseconds one wishes to know whether has passed since '''start_value''' was collected.
 
* '''duration_in_ms''' - period in milliseconds one wishes to know whether has passed since '''start_value''' was collected.
 
| returns = 1 if duration_in_ms has elapsed, 0 if not.
 
| returns = 1 if duration_in_ms has elapsed, 0 if not.
| comments = One needs to take care and not use this syscall when '''start_value''' has been collected before midnight, and the current time is past midnight, because the [[RTC_GetTicks|ticks]] count resets at midnight. If such a situation happens, a almost full day will pass before this syscall returns 1.
+
| comments = One needs to take care and not use this syscall when '''start_value''' has been collected before midnight, and the current time is past midnight, because the [[RTC_GetTicks|ticks]] count resets at midnight. If such a situation happens, a almost full day will pass before this syscall returns 1, or it may even never return 1, in the case that the amount of ticks to midnight is lower than the amount of ticks corresponding to '''duration_in_ms'''.
 
}}
 
}}
 +
[[Category:Syscalls:RTC]]

Latest revision as of 18:59, 10 February 2015


Synopsis

Header: fxcg/rtc.h
Syscall index: 0x02C2
Function signature: int RTC_Elapsed_ms(int start_value, int duration_in_ms)

Checks whether a given amount of milliseconds has elapsed since a specified ticks count.

Parameters

  • start_value - ticks count to compare the current time against.
  • duration_in_ms - period in milliseconds one wishes to know whether has passed since start_value was collected.

Returns

1 if duration_in_ms has elapsed, 0 if not.

Comments

One needs to take care and not use this syscall when start_value has been collected before midnight, and the current time is past midnight, because the ticks count resets at midnight. If such a situation happens, a almost full day will pass before this syscall returns 1, or it may even never return 1, in the case that the amount of ticks to midnight is lower than the amount of ticks corresponding to duration_in_ms.