10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
141
142
143
144
145
146
147
148
151
152
153
154
156
157
158
159
161
162
163
164
165
166
167
168
171
172
173
174
175
176
177
178
179
181QElapsedTimer::ClockType QElapsedTimer::clockType()
noexcept
184 return MonotonicClock;
188
189
190
191
192
193
194
195
196
197
198
199bool QElapsedTimer::isMonotonic()
noexcept
207
208
209
212
213
214
217
218
219
220
221
222
223
224
225
226void QElapsedTimer::start()
noexcept
228 static_assert(
sizeof(t1) ==
sizeof(Duration::rep));
233 TimePoint now = std::chrono::steady_clock::now();
234 t1 = now.time_since_epoch().count();
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256qint64 QElapsedTimer::restart()
noexcept
258 QElapsedTimer old = *
this;
260 return old.msecsTo(*
this);
264
265
266
267
268
269
270
271
272
273
274
275
276
277auto QElapsedTimer::durationElapsed()
const noexcept -> Duration
279 TimePoint then{Duration(t1)};
280 return std::chrono::steady_clock::now() - then;
284
285
286
287
288
289
290
291
292
293
294
295
296
297qint64 QElapsedTimer::nsecsElapsed()
const noexcept
299 return durationElapsed().count();
303
304
305
306
307
308
309
310
311qint64 QElapsedTimer::elapsed()
const noexcept
313 using namespace std::chrono;
314 return duration_cast<milliseconds>(durationElapsed()).count();
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332qint64 QElapsedTimer::msecsSinceReference()
const noexcept
334 using namespace std::chrono;
335 return duration_cast<milliseconds>(Duration(t1)).count();
339
340
341
342
343
344
345
346
347
348
349
350auto QElapsedTimer::durationTo(
const QElapsedTimer &other)
const noexcept -> Duration
353 Duration d2(other.t1);
358
359
360
361
362
363
364
365
366
367qint64 QElapsedTimer::msecsTo(
const QElapsedTimer &other)
const noexcept
369 using namespace std::chrono;
370 return duration_cast<milliseconds>(durationTo(other)).count();
374
375
376
377
378
379
380
381
382
383qint64 QElapsedTimer::secsTo(
const QElapsedTimer &other)
const noexcept
385 using namespace std::chrono;
386 return duration_cast<seconds>(durationTo(other)).count();
392
393
394
395
396
397
398
399
400
401void QElapsedTimer::invalidate()
noexcept
403 t1 = t2 = invalidData;
407
408
409
410
411
412bool QElapsedTimer::isValid()
const noexcept
414 return t1 != invalidData && t2 != invalidData;
418
419
420
421
422
423
424
425
426
427bool QElapsedTimer::hasExpired(qint64 timeout)
const noexcept
431 return quint64(elapsed()) > quint64(timeout);
434bool operator<(
const QElapsedTimer &lhs,
const QElapsedTimer &rhs)
noexcept
436 return lhs.t1 < rhs.t1;
Combined button and popup list for selecting options.
bool operator<(const QElapsedTimer &lhs, const QElapsedTimer &rhs) noexcept
static const qint64 invalidData