/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"

[scriptable, uuid(1648ab6e-6415-fa44-a559-68dc0bbb8164)]
interface koIBenchmark : nsISupports {

    /**
     * Records the start time for the given event name.
     */
    void startTiming(in AString eventname);

    /**
     * Records the end time for the given event name. Must have a matching startTiming call.
     */
    void endTiming(in AString eventname);

    /**
     * Reports that the given event took the given time duration.
     */
    void addTiming(in AString eventname, in long duration);

    /**
     * Reports an event occurred (at the current time).
     */
    void addEvent(in AString eventname);

    /**
     * Reports an event occurred at the given time.
     */
    void addEventAtTime(in AString eventname, in double time);

    /**
     * Dump current benchmark results to stdout.
     */
    void display();
};
