- About CISER Computing
- Computing Resources
- Request a CISER Computing Account
- Computing Node Availability and Usage
- Computing News & User Notes
- HelpDesk Services
- CISER Computing Basics
- CISER Computing FAQ
- CISER Billing FAQ
- Workshop Downloads
- Workshop Schedules & Registration
- Software on the Computing Nodes
- Online Help for Statistical Software
- Buying Statistical Software at Cornell
How to Measure CPU for Stata Jobs
Q:Is there a way to tell how much CPU time Stata takes to
run a particular command or do-file? I know about c(current_time), which
gives clock time, but is there an equivalent to the FULLSTIMER option in
SAS?
A: You can use the -timer- command to record the time spent on sections of code.
Here is a simple example.
---begin log file---
. timer on 1
. sysuse auto, clear
(1978 Automobile Data)
. sum mpg
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
mpg | 74 21.2973 5.785503 12 41
. timer off 1
. timer list 1
1: 11.22 / 1 = 11.2190
--end log file---