Diffusion KWin 9b3d9e58a47a

ScreenEdge: Do not use localtime for measuring duration

Authored by ahiemstra on Feb 3 2020, 10:55 AM.

Description

ScreenEdge: Do not use localtime for measuring duration

Summary:
QDateTime::fromMSecSinceEpoch uses Qt::LocalTime by default. This involves an
expensive localtime conversion. So instead force things to use UTC, as there
is no need for timezone information when tracking durations.

This is especially noticeable on Bedrock Linux, which uses a Fuse mounted
/etc, which is slower than a plain /etc and causes quite some slowdown there.
See https://github.com/bedrocklinux/bedrocklinux-userland/issues/140 for
details.

Test Plan: The screenedge unit test still passes.

Reviewers: KWin, davidedmundson

Reviewed By: KWin, davidedmundson

Subscribers: zzag, anthonyfieroni, davidedmundson, kwin

Tags: KWin

Differential Revision: https://phabricator.kde.org/D27114

Details