1 | Delayed AWT update: |
2 | |
3 | long version; |
4 | long lastUpdate; // AWT time |
5 | |
6 | void data_trigger() {
|
7 | triggerQuickUpdate(); |
8 | triggerShow(++version, 1000); |
9 | } |
10 | |
11 | void awt_quickUpdate() {
|
12 | if (lastUpdate < now()-1000) {
|
13 | getAndRenderContent(); |
14 | lastUpdate = now(); // This can be rough, no problem |
15 | } |
16 | } |
17 | |
18 | void awt_show(long n) {
|
19 | if (n == version) {
|
20 | getAndRenderContent(); |
21 | lastUpdate = now(); |
22 | } |
23 | } |
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1000926 |
| Snippet name: | Delayed AWT update (mid-level implementation description) |
| Eternal ID of this version: | #1000926/1 |
| Text MD5: | 0103fcc42a815b71009a04745f4b294c |
| Author: | stefan |
| Category: | javax |
| Type: | Document |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2015-09-09 17:39:02 |
| Source code size: | 456 bytes / 23 lines |
| Pitched / IR pitched: | No / Yes |
| Views / Downloads: | 762 / 181 |
| Referenced in: | [show references] |