timer_last


Description:

[ Version ( since = "2.16" ) ]
public double timer_last ()

Report the last result of timer_elapsed.

Example: Timers:

public static int main (string[] args) {
Test.init (ref args);

Test.add_func ("/libvaladoc/driver-0.12.x", () => {
Test.timer_start ();
for (int i = 0; i < 10000 ; i++);
double elapsed = Test.timer_elapsed ();
double last_elapsed = Test.timer_last ();
assert (elapsed == last_elapsed);

// When smaller values are better:
Test.minimized_result (elapsed, "for-test: %gsec", elapsed);

// When larger values are better:
Test.maximized_result (elapsed, "for-test: %gsec", elapsed);
});

Test.run ();
return 0;
}

valac --pkg glib-2.0 GLib.Test.minimized_result.vala

./GLib.Test.minimized_result --verbose

Returns:

the last result of timer_elapsed, as a double


Namespace: GLib.Test
Package: glib-2.0