[gimp] Bug 626494 - Enhancement to script-fu-server logging to output milliseconds taken
- From: Michael Schumacher <schumaml src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 626494 - Enhancement to script-fu-server logging to output milliseconds taken
- Date: Sat, 24 Dec 2016 22:45:00 +0000 (UTC)
commit 6e608f6aae5e611585c8c750f0d8473eb97ff41b
Author: Cameron Gregory <public bloke com>
Date: Sat Jun 25 20:52:27 2016 +0200
Bug 626494 - Enhancement to script-fu-server logging to output milliseconds taken
plug-ins/script-fu/script-fu-server.c | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/plug-ins/script-fu/script-fu-server.c b/plug-ins/script-fu/script-fu-server.c
index 2b6e7ed..5d0bb21 100644
--- a/plug-ins/script-fu/script-fu-server.c
+++ b/plug-ins/script-fu/script-fu-server.c
@@ -547,15 +547,16 @@ server_start (const gchar *listen_ip,
static gboolean
execute_command (SFCommand *cmd)
{
- guchar buffer[RESPONSE_HEADER];
- GString *response;
- time_t clock1;
- time_t clock2;
- gboolean error;
- gint i;
+ guchar buffer[RESPONSE_HEADER];
+ GString *response;
+ time_t clocknow;
+ gboolean error;
+ gint i;
+ gdouble total_time;
+ GTimer *timer;
server_log ("Processing request #%d\n", cmd->request_no);
- time (&clock1);
+ timer = g_timer_new ();
response = g_string_new (NULL);
ts_register_output_func (ts_gstring_output_func, response);
@@ -574,10 +575,12 @@ execute_command (SFCommand *cmd)
if (response->len == 0)
g_string_assign (response, ts_get_success_msg ());
- time (&clock2);
- server_log ("Request #%d processed in %f seconds, finishing on %s",
- cmd->request_no, difftime (clock2, clock1), ctime (&clock2));
+ total_time = g_timer_elapsed (timer, NULL);
+ time (&clocknow);
+ server_log ("Request #%d processed in %.3f seconds, finishing on %s",
+ cmd->request_no, total_time, ctime (&clocknow));
}
+ g_timer_destroy (timer);
buffer[MAGIC_BYTE] = MAGIC;
buffer[ERROR_BYTE] = error ? TRUE : FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]