Skip to content

09. timer & console #9

@xgqfrms

Description

@xgqfrms

timer & console

timer

https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Code_snippets/Timers

  1. setTimeout
  2. setInterval
  3. requestAnimationFrame

https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout

https://developer.mozilla.org/en-US/docs/Web/API/console/assert

https://developer.mozilla.org/en-US/docs/Web/API/Performance/now

https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame

image

IDLE

idle meaning in js

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/idle

https://www.cnblogs.com/xgqfrms/p/11433168.html

// var handle = window.requestIdleCallback(callback[, options])
var handle = window.requestIdleCallback(
    (IdleDeadline) => console.log(`handle =`, window.handle, IdleDeadline),
    {
        timeout: 1000,// mm
    }
);

// handle = 13 IdleDeadline {didTimeout: false}

// didTimeout: false__proto__: IdleDeadlinedidTimeout: (...)timeRemaining: ƒ timeRemaining()constructor: ƒ IdleDeadline()Symbol(Symbol.toStringTag): "IdleDeadline"get didTimeout: ƒ didTimeout()__proto__: Objectconstructor: ƒ Object()hasOwnProperty: ƒ hasOwnProperty()isPrototypeOf: ƒ isPrototypeOf()propertyIsEnumerable: ƒ propertyIsEnumerable()toLocaleString: ƒ toLocaleString()toString: ƒ toString()valueOf: ƒ valueOf()__defineGetter__: ƒ __defineGetter__()__defineSetter__: ƒ __defineSetter__()__lookupGetter__: ƒ __lookupGetter__()__lookupSetter__: ƒ __lookupSetter__()get __proto__: ƒ __proto__()set __proto__: ƒ __proto__()

window.cancelIdleCallback(handle);

https://alligator.io/js/console-time-timeend/
https://flaviocopes.com/requestanimationframe/
https://css-tricks.com/using-requestanimationframe/
http://javascriptkit.com/javatutors/requestanimationframe.shtml

https://developers.google.com/web/updates/2012/08/When-milliseconds-are-not-enough-performance-now


console

https://developer.mozilla.org/en-US/docs/Web/API/Console

https://developer.mozilla.org/en-US/docs/Web/API/console#Timers

  1. color css
  2. job ads
  3. table / format

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions