VgaGames4

VgaGames4 - miscellaneous man-pages

[.. upper level ..]

# vg4->misc->time_delta()

Return the time-difference in milliseconds since last call.

SYNTAX
long vg4->misc->time_delta(long *tlast)
FUNCTION PARAMETERS

tlast | Address to last time of call, will be updated

RETURN VALUE
Returns time-difference in milliseconds
DESCRIPTION
Return the time-difference in milliseconds since last call.
EXAMPLE

    /* example use */

    long tlast = 0;

    /* check sleep-time */
    vg4->misc->time_delta(&tlast);
    sleep(1);
    printf("Time slept in milliseconds: %ld\n", vg4->misc->time_delta(&tlast));

    /* check sleep-time again */
    vg4->misc->time_delta(&tlast);
    sleep(2);
    printf("Time slept in milliseconds: %ld\n", vg4->misc->time_delta(&tlast));