File: time.rsd

package info (click to toggle)
ruby-sdl 2.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, stretch
  • size: 1,544 kB
  • ctags: 1,359
  • sloc: cpp: 7,598; ansic: 4,498; ruby: 2,246; makefile: 106; sh: 102
file content (46 lines) | stat: -rw-r--r-- 950 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
= Time
TOC
SDL provides several cross-platform functions for dealing with
time.
It provides a way to get the current time
and a way to wait a little while.

==Methods
%%%
NAME get_ticks
TYPE .
PURPOSE Get the number of milliseconds since the SDL library initialization
RVAL UINT

PROTO
get_ticks
getTicks

DESC
Get the number of milliseconds since @[init] is called
Note that this value wraps if the program runs
for more than ~49 days.

SEEALSO
delay

%%
NAME delay
TYPE .
PURPOSE Wait a specified number of milliseconds before returning

PROTO
delay(ms)

DESC
Wait a specified number of milliseconds before returning.
This method will wait ((*at least*)) the specified time, 
but possible longer due to OS scheduling.

NOTES
Count on a delay granularity of ((*at least*)) 10 ms. Some
platforms have shorter clock ticks but this is the most
common.

Ruby's threads cannot preempt while waiting with this method.
You should use Kernel#sleep instead.