mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-24 02:50:24 +01:00
perf/README: Update due to cairo_perf_timer API changes
This commit is contained in:
parent
3c407aa80a
commit
1085d99bc3
1 changed files with 6 additions and 12 deletions
18
perf/README
18
perf/README
|
|
@ -36,32 +36,26 @@ Here is the basic structure of a performance test file:
|
|||
* Please copy the MIT blurb as in other tests
|
||||
*/
|
||||
|
||||
#include "cairo-perf"
|
||||
#include "cairo-perf.h"
|
||||
|
||||
double
|
||||
cairo_perf_ticks_t
|
||||
my_new_test (cairo_t *cr, int width, int height)
|
||||
{
|
||||
cairo_perf_timer_t timer;
|
||||
|
||||
/* First do any setup for which the execution time should not
|
||||
* be measured. For example, this might include loading
|
||||
* images from disk, creating patterns, etc. */
|
||||
|
||||
timer_start (&timer);
|
||||
cairo_perf_timer_start ();
|
||||
|
||||
/* Now make the real cairo calls to be measured */
|
||||
|
||||
timer_stop (&timer);
|
||||
cairo_perf_timer_stop ();
|
||||
|
||||
/* Finally, any cleanup */
|
||||
|
||||
/* Then return the inverse of the time that elapsed so that
|
||||
* the return value measures a rate, (how many times per
|
||||
* second your code can be executed). We use rates rather
|
||||
* than times for a "bigger is better" effect in the
|
||||
* results. */
|
||||
/* Then return the time that elapsed. */
|
||||
|
||||
return 1.0 / timer_elapsed (&timer);
|
||||
return cairo_perf_timer_elapsed ();
|
||||
}
|
||||
|
||||
That's really all there is to writing a new test. Then, to fully
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue