Skip to content

Instantly share code, notes, and snippets.

@tomgco
Created September 9, 2013 18:33
Show Gist options
  • Save tomgco/6499637 to your computer and use it in GitHub Desktop.
Save tomgco/6499637 to your computer and use it in GitHub Desktop.
var v8 = require('strong-cpu-profiler')
, fs = require('fs')
v8.startProfiling('a')
console.log('a')
var profile = v8.stopProfiling('a')
fs.writeFileSync('a.nom', JSON.stringify({
title: profile.title,
uid: profile.uid,
typeId: 'CPU',
head: profile.getTopDownRoot(),
bottomUpHead: profile.getBottomUpRoot()
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment