Timestamp: 1620986374484

useTimestamp

Reactive current timestamp

Usage

import { useTimestamp } from '@vueuse/core'

const { timestamp, pause, resume } = useTimestamp({ offset: 0 })

Type Declarations

export interface TimestampOptions {
  /**
   * Offset value adding to the value
   *
   * @default 0
   */
  offset?: number
  /**
   * Update interval, or use requestAnimationFrame
   *
   * @default requestAnimationFrame
   */
  interval?: "requestAnimationFrame" | number
}
/**
 * Reactive current timestamp.
 *
 * @see /useTimestamp
 * @param options
 */
export declare function useTimestamp(
  options?: TimestampOptions
): {
  isActive: Ref<boolean>
  pause: Fn
  resume: Fn
  timestamp: Ref<number>
}

Source

SourceDemoDocs