delta_time 1.0.1

A simple library for keeping track of time in games


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

delta_time

A simple library for keeping track of the delta time in games.

This library will give you the delta time in a double floating point number.

Here is a small example on how to use it:

 import std.stdio;

import delta_time;

void main()
{
	bool running = true;

    int count = 0;

    // This is the game loop
    while (running) {

        // The delta must be calculated first
        calculateDelta();

        // Do some random work as an example
        int w = 0;
        for (int i = 1; i < 2_000_000; i++) {
            w = w * i;
        }
        count++;
        if (count > 10_000) {
            running = false;
        }

        // Now we can just grab the delta anywhere in the project
        double delta = getDelta();

        writeln("The delta is: ", delta);
    }
}
Authors:
  • jordan4ibanez
Dependencies:
none
Versions:
1.0.2 2022-Aug-05
1.0.1 2022-Aug-05
1.0.0 2022-Aug-05
~main 2022-Aug-05
Show all 4 versions
Download Stats:
  • 1 downloads today

  • 3 downloads this week

  • 3 downloads this month

  • 3 downloads total

Score:
0.4
Short URL:
delta_time.dub.pm