GetSpeed

This function returns the application speed. The application speed is a value which can be used to modulate time-dependent variables to make actions occur at the same speed, regardless of frame rate.

Syntax

Returns

Returns the application speed.

Example

--Create a window
window = Window:Create()
context = Context:Create(window)
world = World:Create()
local camera = Camera:Create()
camera:Move(0,0,-3)
local light = DirectionalLight:Create()
light:SetRotation(35,35,0)

model = Model:Box()
model:SetColor(0.0,0.0,1.0)

while true do

if window:Closed() or window:KeyHit(Key.Escape) then return false end

--Press the space key to stop the program for one second
if (window:KeyHit(Key.Space)) then Time:Delay(1000) end

model:Turn(0,Time:GetSpeed(),0)

Time:Update()
world:Update()
world:Render()

context:SetBlendMode(Blend.Alpha)
context:DrawText("Speed: "..Time:GetSpeed(),2,2)

context:Sync()

end