Published as @freesewing/plugin-timing, this plugin measures detailed timing information while drafting a design and adds it to the pattern store.

It is intended to be used by developers trying to determine which parts of their code are slow, or in general to provide insights into the speed at which a design can be drafted.


Shell prompt
npm install @freesewing/plugin-timing


Either add it as a part plugins in your design, or add it to a pattern instance with Pattern.use().

To import the plugin for use:

import { timingPlugin } from '@freesewing/plugin-timing'
// or
import { pluginTiming } from '@freesewing/plugin-timing'

Information in store

The plugin adds the following key/value pairs to the store before and after the pattern and parts drafting process.

timing.draft.startTimestamp for the start of the pattern drafting process
timing.draft.tookTime it took to draft the pattern[part name].startTimestamp for the start of the part drafting process[part name].tookTime it took to draft the part

Units and types depend on whether the pattern is generated in a browser or via Node.js.

  • If the pattern is generated in a browser, both start timestamps and draft times are in milliseconds, and the values are Numbers.

  • If the pattern is generated via Node.js, start timestamps are in nanoseconds, draft times are in microseconds, and the values are BigInts.


Via Node.js

import { Aaron } from '@freesewing/aaron'
import { pluginTiming } from '@freesewing/plugin-timing'

// Load some public test measurements from the FreeSewing backend
const measurements = (
  await (
    await fetch("")

const pattern = new Aaron({ measurements }).use(pluginTiming)

const svg = pattern.draft().render()

const patternTook = pattern.setStores[0].get(['timing', 'draft', 'took'])
console.log('The Aaron pattern took ' + patternTook + ' µs to draft.')

const frontTook = pattern.setStores[0].get(['timing', 'parts', 'aaron.front', 'took'])
console.log('The aaron.front part took ' + frontTook + ' µs to draft.')

  (key, value
) => typeof value === 'bigint' ? value.toString() : value))

In a browser

For example, in designs/aaron/src/back.mjs:

import { pluginTiming } from '@freesewing/plugin-timing'
import { front } from '@freesewing/aaron'

export const back = {
  from: front,
  plugins: [ pluginTiming ],
  draft: ({
) => {

  const frontTook = store.get(['timing', 'parts', 'aaron.front', 'took'])'The aaron.front part took ' + frontTook + ' ms to draft.')

  return part