app: add simple macros GIMP_TIMER_START() and GIMP_TIMER_END()

which measure the time taken between them and print out a message.
Use it for projection benchmarking and add timing to scaling.
This commit is contained in:
Michael Natterer
2010-06-06 20:24:27 +02:00
parent 17961941fc
commit 8a27702ac3
3 changed files with 17 additions and 6 deletions

View File

@ -19,6 +19,15 @@
#define __APP_GIMP_UTILS_H__
#define GIMP_TIMER_START() \
{ GTimer *_timer = g_timer_new ();
#define GIMP_TIMER_END(message) \
g_printerr ("%s: " message " took %0.2f seconds\n", \
G_STRFUNC, g_timer_elapsed (_timer, NULL)); \
g_timer_destroy (_timer); }
gint64 gimp_g_type_instance_get_memsize (GTypeInstance *instance);
gint64 gimp_g_object_get_memsize (GObject *object);
gint64 gimp_g_hash_table_get_memsize (GHashTable *hash,