Home / File/ timing.js — svelte Source File

timing.js — svelte Source File

Architecture documentation for timing.js, a javascript file in the svelte codebase. 3 imports, 3 dependents.

File javascript ClientRuntime Hydration 3 imports 3 dependents 3 functions

Entity Profile

Dependency Diagram

graph LR
  fa5af256_aedf_fd58_ea3f_a0325a1204b6["timing.js"]
  cb946435_ce66_d1e8_6bee_287bdb07e7c5["utils.js"]
  fa5af256_aedf_fd58_ea3f_a0325a1204b6 --> cb946435_ce66_d1e8_6bee_287bdb07e7c5
  fa007f2b_f437_c5ef_5c2d_ea8b5902500f["noop"]
  fa5af256_aedf_fd58_ea3f_a0325a1204b6 --> fa007f2b_f437_c5ef_5c2d_ea8b5902500f
  c9866d91_a204_fa55_a9e3_6bcc6aaaec1e["esm-env"]
  fa5af256_aedf_fd58_ea3f_a0325a1204b6 --> c9866d91_a204_fa55_a9e3_6bcc6aaaec1e
  385470d9_b5f1_1cd1_d8da_e61454f3e60a["loop.js"]
  385470d9_b5f1_1cd1_d8da_e61454f3e60a --> fa5af256_aedf_fd58_ea3f_a0325a1204b6
  5230511f_b608_2c86_cb6b_11014fdf94b5["spring.js"]
  5230511f_b608_2c86_cb6b_11014fdf94b5 --> fa5af256_aedf_fd58_ea3f_a0325a1204b6
  99a316ef_52a9_1ecb_3a20_489761af28ad["tweened.js"]
  99a316ef_52a9_1ecb_3a20_489761af28ad --> fa5af256_aedf_fd58_ea3f_a0325a1204b6
  style fa5af256_aedf_fd58_ea3f_a0325a1204b6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/** @import { Raf } from '#client' */
import { noop } from '../shared/utils.js';

import { BROWSER } from 'esm-env';

const now = BROWSER ? () => performance.now() : () => Date.now();

/** @type {Raf} */
export const raf = {
	// don't access requestAnimationFrame eagerly outside method
	// this allows basic testing of user code without JSDOM
	// bunder will eval and remove ternary when the user's app is built
	tick: /** @param {any} _ */ (_) => (BROWSER ? requestAnimationFrame : noop)(_),
	now: () => now(),
	tasks: new Set()
};

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does timing.js do?
timing.js is a source file in the svelte codebase, written in javascript. It belongs to the ClientRuntime domain, Hydration subdomain.
What functions are defined in timing.js?
timing.js defines 3 function(s): now, raf.now, raf.tick.
What does timing.js depend on?
timing.js imports 3 module(s): esm-env, noop, utils.js.
What files import timing.js?
timing.js is imported by 3 file(s): loop.js, spring.js, tweened.js.
Where is timing.js in the architecture?
timing.js is located at packages/svelte/src/internal/client/timing.js (domain: ClientRuntime, subdomain: Hydration, directory: packages/svelte/src/internal/client).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free