1. A method of obtaining performance counter data, in a computer simulator simulating a computer architecture, comprising: retrieving an instruction to execute from an input instruction stream; retrieving a callback associated with the instruction from the input instruction stream, wherein the callback, when executed, is configured to calculate performance counter data for a performance counter; executing, by operation of one or more computer processors, the instruction on the computer simulator; and upon determining that the performance counter associated with the retrieved callback has been queried within a predetermined period of time, executing the callback in order to calculate the performance counter data for the performance counter.