[PATCH] Fix of elapsed time string generation in query window

From: Иван Полещук <cyberj0g(at)gmail(dot)com>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: [PATCH] Fix of elapsed time string generation in query window
Date: 2016-02-11 06:48:38
Message-ID: CACg4f+WQ4eCL66WP5KWE3mevHZKK2UgqAUMLLU+y7kJ6Pjngkg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

From 5a5460dc2ec5491660dc8358e878eb9342fbc0f8 Mon Sep 17 00:00:00 2001
From: cyberj0g <cyberj0g(at)gmail(dot)com>
Date: Wed, 10 Feb 2016 00:24:52 +0500
Subject: [PATCH] Fix of elapsed time string generation in query window

For queries longer than 1 hour, time was displayed like that:
"01:25:3640 hours"
---
pgadmin/utils/misc.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pgadmin/utils/misc.cpp b/pgadmin/utils/misc.cpp
index b050dd7..f0047b3 100644
--- a/pgadmin/utils/misc.cpp
+++ b/pgadmin/utils/misc.cpp
@@ -226,7 +226,7 @@ wxString ElapsedTimeToStr(wxLongLong msec)
int days = tsMsec.GetDays();
int hours = (wxTimeSpan(tsMsec.GetHours(), 0, 0, 0) -
wxTimeSpan(days * 24)).GetHours();
int minutes = (wxTimeSpan(0, tsMsec.GetMinutes(), 0, 0) -
wxTimeSpan(hours)).GetMinutes();
- long seconds = (wxTimeSpan(0, 0, tsMsec.GetSeconds(), 0) -
wxTimeSpan(0, minutes)).GetSeconds().ToLong();
+ long seconds = (wxTimeSpan(0, 0, tsMsec.GetSeconds(), 0) -
wxTimeSpan(hours, minutes)).GetSeconds().ToLong();
long milliseconds = (wxTimeSpan(0, 0, 0, tsMsec.GetMilliseconds()) -
wxTimeSpan(0, 0, seconds)).GetMilliseconds().ToLong();

if (days > 0)

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Harshal Dhumal 2016-02-11 08:36:23 Re: [pgAdmin4] [Patch]: Language Module
Previous Message Akshay Joshi 2016-02-11 06:39:27 Re: patch for cast module