Usage

Measure an operation without relying on wall-clock changes.

This type is used by global.fetch

tsx
// Measure an operation without relying on wall-clock changes.
const start = performance.now();
const response = await fetch('https://example.com/api/health');
console.log(response.status, performance.now() - start);

Type declaration

ts
interface RequestInit {
    method?: 'GET' | 'HEAD' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS';
    headers?: HeadersInit;
    /**
     * A string goes as UTF-8, `text/plain;charset=UTF-8` unless a content type
     * is set; URLSearchParams as a form.
     */
    body?: BodyInit | null;
    signal?: AbortSignal | null;
  }

Members 4

NameTypeRequiredDescription
method"POST" | "PUT" | "PATCH" | "GET" | "HEAD" | "DELETE" | "OPTIONS"No—
headersHeadersInitNo—
bodyBodyInitNoA string goes as UTF-8, text/plain;charset=UTF-8 unless a content type is set; URLSearchParams as a form.
signalAbortSignalNo—
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.