How to use w3c-hr-time - 4 common examples

To help you get started, we’ve selected a few w3c-hr-time examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sx1989827 / DOClever / node_modules / jsdom / lib / jsdom / browser / Window.js View on Github external
function Window(options) {
  EventTarget.setup(this);

  const rawPerformance = new RawPerformance();
  const windowInitialized = rawPerformance.now();

  const window = this;

  mixin(window, WindowEventHandlersImpl.prototype);
  mixin(window, GlobalEventHandlersImpl.prototype);

  this._initGlobalEvents();

  ///// INTERFACES FROM THE DOM
  // TODO: consider a mode of some sort where these are not shared between all DOM instances
  // It'd be very memory-expensive in most cases, though.
  for (const name in dom) {
    Object.defineProperty(window, name, {
      enumerable: false,
      configurable: true,
github flaviuse / mern-authentication / client / node_modules / jsdom / lib / jsdom / browser / Window.js View on Github external
function Window(options) {
  EventTarget.setup(this);

  const rawPerformance = new RawPerformance();
  const windowInitialized = rawPerformance.now();

  const window = this;

  mixin(window, WindowEventHandlersImpl.prototype);
  mixin(window, GlobalEventHandlersImpl.prototype);

  this._initGlobalEvents();

  ///// INTERFACES FROM THE DOM
  // TODO: consider a mode of some sort where these are not shared between all DOM instances
  // It'd be very memory-expensive in most cases, though.
  for (const name in dom) {
    Object.defineProperty(window, name, {
      enumerable: false,
      configurable: true,
github jsdom / jsdom / lib / jsdom / browser / Window.js View on Github external
function Window(options) {
  setupWindow(this, { runScripts: options.runScripts });

  const rawPerformance = new RawPerformance();
  const windowInitialized = rawPerformance.now();

  const window = this;

  ///// PRIVATE DATA PROPERTIES

  this._resourceLoader = options.resourceLoader;

  // vm initialization is deferred until script processing is activated
  this._globalProxy = this;
  Object.defineProperty(idlUtils.implForWrapper(this), idlUtils.wrapperSymbol, { get: () => this._globalProxy });

  let timers = Object.create(null);
  let animationFrameCallbacks = Object.create(null);

  // List options explicitly to be clear which are passed through
github pinterest / service-workers / packages / service-worker-mock / index.js View on Github external
this.Headers = Headers;
    this.importScripts = () => {};
    this.indexedDB = new IDBFactory();
    this.IDBKeyRange = IDBKeyRange;
    this.IDBDatabase = IDBDatabase;
    this.IDBObjectStore = IDBObjectStore;
    this.resetIDB = resetIDB;
    this.MessageEvent = MessageEvent;
    this.MessageChannel = MessageChannel;
    this.MessagePort = MessagePort;
    this.Notification = Notification;
    this.NotificationEvent = NotificationEvent;
    this.PushEvent = PushEvent;
    this.PushManager = PushManager;
    this.PushSubscription = PushSubscription;
    this.performance = new Performance();
    this.Request = Request;
    this.Response = Response;
    this.SyncEvent = SyncEvent;
    this.ServiceWorkerGlobalScope = ServiceWorkerGlobalScope;
    this.URL = URL;
    this.URLSearchParams = URLSearchParams;
    this.navigator = {};
    this.navigator.userAgent = options.userAgent;

    this.WindowClient = WindowClient;

    this.trigger = (name, args) => {
      if (this.listeners.has(name)) {
        return eventHandler(
          name,
          args,

w3c-hr-time

An implementation of the W3C High Resolution Time Level 2 specification.

MIT
Latest version published 4 years ago

Package Health Score

52 / 100
Full package analysis

Popular w3c-hr-time functions

Similar packages