UPS

This function returns the application updates per second.

Syntax

Returns

Returns the updates per second value. This is normally synonymous to frames per second (FPS).

Example

#include "Leadwerks.h"

using namespace Leadwerks;

Model* model = NULL;
bool paused = false;

int main(int argc, const char *argv[])
{
Leadwerks::Window* window = Leadwerks::Window::Create();
Context* context = Context::Create(window);
World* world = World::Create();
Camera* camera = Camera::Create();
camera->Move(0,0,-3);
Light* light = DirectionalLight::Create();
light->SetRotation(35,35,0);

model = Model::Box();
model->SetColor(0.0,0.0,1.0);

while (true)
{
if (window->Closed() || window->KeyDown(Key::Escape)) return false;

model->Turn(0,Leadwerks::Time::GetSpeed(),0);

Leadwerks::Time::Update();
world->Update();
world->Render();

context->SetBlendMode(Blend::Alpha);
context->DrawText("UPS: "+String(Leadwerks::Time::UPS()),2,2);

context->Sync(false);
}
return 0;
}