annotate tests/data/timer.js @ 1201:67fa43998a91 default tip @

misc: update copyright years
author David Demelier <markand@malikania.fr>
date Thu, 04 Jan 2024 10:39:43 +0100
parents 371e1cc2c697
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
963
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 count = 0;
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
2
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 function onLoad()
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 {
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 if (typeof (type) === "undefined")
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 throw Error("global timer type not defined");
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
7
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 t = new Irccd.Timer(type, 50, function () {
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 count += 1;
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 });
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
11
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 t.start();
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 }