[sysprof] profiler: reset timer when starting
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] profiler: reset timer when starting
- Date: Thu, 14 Apr 2016 12:49:16 +0000 (UTC)
commit 89e75fae2d54c2baad94d90060bee349e80b9994
Author: Christian Hergert <chergert redhat com>
Date: Thu Apr 14 05:39:49 2016 -0700
profiler: reset timer when starting
If we reuse the profiler instance (not convinced this is a good idea yet)
then we could have a nonzero elapsed time. Reset it immediately so that
the UI doesn't jitter between the previous value and 00:00.
lib/sp-local-profiler.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/lib/sp-local-profiler.c b/lib/sp-local-profiler.c
index f3ca162..59cd5f1 100644
--- a/lib/sp-local-profiler.c
+++ b/lib/sp-local-profiler.c
@@ -459,6 +459,9 @@ sp_local_profiler_start (SpProfiler *profiler)
g_return_if_fail (priv->is_stopping == FALSE);
g_return_if_fail (priv->is_starting == FALSE);
+ g_clear_pointer (&priv->timer, g_timer_destroy);
+ g_object_notify (G_OBJECT (self), "elapsed");
+
if (priv->writer == NULL)
{
SpCaptureWriter *writer;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]