This is as days pass by, by Stuart Langridge

And this is DTrace-ing JavaScript, written , and concerning Talk Like A Pirate Day, Software

Arr! Me hearties! I be highly impressed to see that prime landlubber Brendan Gregg be applying the power of DTrace t' JavaScript. For those o' ye scurvy dogs that dunno, DTrace be this marvellous thing on Solaris that traces kernel calls. Apparently it be for more than that, though; see Brandan trace the JavaScript code
function padZero(i)
{
        if (i < 10) return "0" + i
        return i
}

function startTime()
{
        var now = new Date
        var time = padZero(now.getHours()) + ":" +
            padZero(now.getMinutes()) + ":" +
            padZero(now.getSeconds());
        document.getElementById('clock').innerHTML = "time: " + time + "
" var timeout = setTimeout('startTime()', 1000) }
and be gettin' the followin' output:
 FILE                   FUNC                          CALLS
 clock.html             getElementById                    9
 clock.html             getHours                          9
 clock.html             getMinutes                        9
 clock.html             getSeconds                        9
 clock.html             setTimeout                        9
 clock.html             startTime                         9
 clock.html             padZero                          27
as well as much more complex output t' be seen below. Every day I be amazed at DTrace, and now I be even more amazed as it be useful for work that I actually do. Avast!

Comments

This website belongs to Stuart Langridge. Contact details are available. Don't eat yellow snow. Valid HTML5, at least in theory, except for the bits that aren't because I'm that futuristic that I'm ahead of the spec, oh yes. HTML5 help from Bruce Lawson, among others. Fonts from the superb FontSquirrel. End.