[TIMOB-17146] Android: $.theWindow.size execution time depends on something
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 3.2.3 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Fix Please |
Assignee | Unknown |
Created | 2014-05-03T13:53:21.000+0000 |
Updated | 2018-02-28T20:03:44.000+0000 |
Description
Time of taking window size depends on something and varies from (<=1) millisecond and up to tens of milliseconds. See the attached screenshots.
<Alloy>
<Window id="theWindow" class="container">
<Label id="label1" left="10" top="10">0.0</Label>
<Label id="label2" left="10" top="30">Interval: 0.0 ms</Label>
<Button left="70" top="50" onClick="onButton">Change Interval</Button>
</Window>
</Alloy>
$.theWindow.open();
var interval = 100;
function step() {
var beginTime = new Date().getTime();
/////
var size = $.theWindow.size;
/////
var endTime = new Date().getTime();
var executionTime = endTime - beginTime;
$.label1.setText(executionTime);
}
var timerId1 = setInterval(step, interval);
function updateLabel() {
$.label2.setText('Interval: ' + interval + ' ms');
}
var timerId = setInterval(updateLabel, interval);
function onButton() {
if (interval == 100) {
interval = 1;
}
else if (interval == 1) {
interval = 10;
}
else {
interval = 100;
}
clearInterval(timerId);
timerId = setInterval(updateLabel, interval);
}
Attachments
File | Date | Size |
---|---|---|
interval1_1.png | 2014-05-03T13:53:21.000+0000 | 12894 |
interval1_2.png | 2014-05-03T13:53:21.000+0000 | 12921 |
interval1_3.png | 2014-05-03T13:53:21.000+0000 | 12633 |
interval10_1.png | 2014-05-03T13:53:22.000+0000 | 13159 |
interval10_2.png | 2014-05-03T13:53:22.000+0000 | 12899 |
interval10_3.png | 2014-05-03T13:53:22.000+0000 | 12806 |
interval100_1.png | 2014-05-03T13:53:21.000+0000 | 10741 |
interval100_2.png | 2014-05-03T13:53:21.000+0000 | 10854 |
Moving this ticket to engineering as I can reproduce the timing behavior with the provided test case, as described in this ticket.