After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 587614 - Method to measure how long a window is showing up
Method to measure how long a window is showing up
Status: RESOLVED FIXED
Product: LDTP
Classification: Other
Component: pyldtp
1.6.0
Other Linux
: Normal enhancement
: ---
Assigned To: Nagappan Alagappan
LDTP Development Mailing List
Depends on:
Blocks:
 
 
Reported: 2009-07-02 15:12 UTC by Ara Pulido
Modified: 2009-08-12 15:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (9.84 KB, patch)
2009-08-08 02:28 UTC, Nagappan Alagappan
committed Details | Review

Description Ara Pulido 2009-07-02 15:12:53 UTC
I would love to have a method that returns the time (in milliseconds) that a window has been showing in the screen.

Right now I use:

waittillguiexists(window)
start_time = time.time()
waittillguinotexists(window)
end_time = time.time()

but that has a measure error of about 1.5 seconds.

It would be great to have something like:

time = showing_time(window)

that will return how long the window was showing on the screen.
Comment 1 Nagappan Alagappan 2009-08-08 02:28:40 UTC
Created attachment 140170 [details] [review]
Proposed patch

windowuptime('dlgRunApplication')

Returns

(datetime.datetime(2009, 8, 7, 19, 22, 42),
 datetime.datetime(2009, 8, 7, 19, 22, 48))

First one start time, the next one is end time - python datetime instace

Is this fine ?

The input argument, for now will be LDTP convention like dlgWindowName etc.

Please let me know, if this is okay ?

Waiting for your response, before committing it :)

Thanks
Comment 2 Ara Pulido 2009-08-11 05:33:06 UTC
This is perfect solution. Thanks!
Comment 3 Nagappan Alagappan 2009-08-12 15:41:06 UTC
Thanks for the bug report. Committed the fix in git. Will document it soon :)