Skip to content

Instantly share code, notes, and snippets.

View ehaynes99's full-sized avatar

Eric Haynes ehaynes99

View GitHub Profile
import { performance } from 'perf_hooks'
export type Timer = ReturnType<typeof createTimer>
/**
* High resolution timer. Note that Number.MAX_SAFE_INTEGER
* limits the total duration to ~104 hours.
*/
export const createTimer = () => {
const times: number[] = []
@ehaynes99
ehaynes99 / typebox-example.md
Created March 21, 2023 00:04
TypeBox example

Schema Definition

export const Customer = Type.Object({
  firstName: Type.String(),
  lastName: Type.String(),
  age: Type.Number(),
  dob: Type.Date(),
  address: Type.Object({
    streetAddress: Type.String(),
    city: Type.String(),