File: zoneOffset.qml

package info (click to toggle)
qt6-declarative 6.9.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 308,920 kB
  • sloc: cpp: 775,911; javascript: 514,247; xml: 10,855; python: 2,806; ansic: 2,253; java: 810; sh: 262; makefile: 41; php: 27
file content (16 lines) | stat: -rw-r--r-- 515 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Benchmarks determination of local time-zone offset.
// This can be sensitive to changes to QTimeZone or QDateTime (depends on platform).

import QtQuick 2.0

QtObject {
    function runtest() {
        var tick = -864e8; // 1000 days before the epoch
        for (var ii = 0; ii < 5000000; ++ii) {
            new Date(tick).getTimezoneOffset();
            tick += 5e5;
        }
        // 25e11 milliseconds is about 79 years; so we span from
        // the start of 1967-04-07 to 2046-6-26 04:18:20.
    }
}