# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1593441478 -7200
# Node ID e6c1e92cc7a71539817249dc15d8819e9604e46f
# Parent  eaee72c7afbdf9f120ef0c9374813c7abeabaefe
util.timer: Defer to selected net.server if it implements this API

E.g. net.server_epoll is very close and could easily be adapted to
support this.

diff -r eaee72c7afbd -r e6c1e92cc7a7 util/timer.lua
--- a/util/timer.lua	Mon Jun 29 12:51:28 2020 +0100
+++ b/util/timer.lua	Mon Jun 29 16:37:58 2020 +0200
@@ -16,6 +16,11 @@
 local xpcall = require "util.xpcall".xpcall;
 local math_max = math.max;
 
+if server.timer then
+	-- The selected net.server implements this API, so defer to that
+	return server.timer;
+end
+
 local _ENV = nil;
 -- luacheck: std none