All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.scalajs.dom.Performance.scala Maven / Gradle / Ivy

There is a newer version: 0.4.2
Show newest version
package io.scalajs.dom

import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal

/**
  * The Performance.now() method returns a DOMHighResTimeStamp, measured in milliseconds, accurate to
  * one thousandth of a millisecond.
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Performance
  * @author [email protected]
  */
@js.native
@JSGlobal("Performance")
class Performance extends js.Object {

  /**
    * The measure() method creates a named timestamp in the browser's performance entry buffer between two specified
    * marks (known as the start mark and end mark, respectively). The named timestamp is referred to as a measure.
    *
    * The measure can be retrieved by one of the Performance interface's getEntries*() methods (getEntries(),
    * getEntriesByName() or getEntriesByType()).
    * @param name      A DOMString representing the name of the measure.
    * @param startMark A DOMString representing the name of the measure's starting mark.
    *                  May also be the name of a PerformanceTiming property.
    * @param endMark   A DOMString representing the name of the measure's ending mark.
    *                  May also be the name of a PerformanceTiming property.
    */
  def measure(name: String, startMark: String = js.native, endMark: String = js.native): Unit = js.native

  /**
    * @return a DOMHighResTimeStamp, measured in milliseconds, accurate to one thousandth of a millisecond.
    */
  def now(): DOMHighResTimeStamp = js.native

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy