diff tests/data/timer.js @ 963:371e1cc2c697

tests: add 80% of the Javascript API
author David Demelier <markand@malikania.fr>
date Thu, 28 Jan 2021 14:20:58 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/data/timer.js	Thu Jan 28 14:20:58 2021 +0100
@@ -0,0 +1,13 @@
+count = 0;
+
+function onLoad()
+{
+	if (typeof (type) === "undefined")
+		throw Error("global timer type not defined");
+
+	t = new Irccd.Timer(type, 50, function () {
+		count += 1;
+	});
+
+	t.start();
+}