setTimeout method
Implementation
int setTimeout(String vmId, VoidCallback function, int milliseconds) {
final Map<int, JSTimeout> cache = _globalCache.putIfAbsent(vmId, () => <int, JSTimeout>{});
final JSTimeout timeout = JSTimeout(function, milliseconds);
final int timeoutId = timeout.id;
cache[timeoutId] = timeout;
timeout.emit().then((_) {
cache.remove(timeoutId);
});
return timeoutId;
}