How to Use the typeperf Command to Monitor Performance in Windows 11

The Limitations of the Task Manager

When a Windows 11 computer starts running slowly, the first instinct is to press Ctrl+Shift+Esc to open the graphical Task Manager. While the Task Manager is excellent for killing frozen applications, it is terrible for long-term historical analysis. It only shows you what is happening right now. If a server spikes to 100% CPU utilization at 3:00 AM while you are asleep, the Task Manager will not record it.

To record system performance over long periods of time (like an entire weekend), you need to tap into the Windows Performance Counters. While there is a complex graphical “Performance Monitor” tool built into Windows, it is bulky and difficult to automate across multiple computers.

To effortlessly track, record, and export hardware performance metrics directly from the command line, you must use the typeperf command.

Step 1: Open the Command Prompt

Because you are interacting with low-level hardware diagnostics, you must run this tool with administrative privileges.

  1. Press the Windows Key, type cmd.
  2. Right-click on Command Prompt and select Run as administrator.

Step 2: Understanding Performance Counters

Windows tracks thousands of different “counters,” ranging from total CPU usage to the exact number of bytes being written to the hard drive per second. Before you can record anything, you need to know the exact name of the counter you want to track.

The syntax for a counter name is always \Category\Counter.

For example, the counter for total processor usage is: \Processor(_Total)\% Processor Time.

To see a massive list of every single counter your computer supports, run:

typeperf -q

Step 3: Running a Live Monitor

Once you know the exact name of your counter, you can tell typeperf to display the data live in the terminal.

typeperf "\Processor(_Total)\% Processor Time"

Because the counter name contains spaces, it must be enclosed in quotation marks.

When you press Enter, the terminal will wait one second, and then output a timestamp alongside the exact percentage of your CPU currently being used. It will continue doing this every single second until you manually stop it by pressing Ctrl + C.

Step 4: Monitoring Multiple Metrics

You are not limited to tracking a single piece of hardware. You can chain multiple counters together in a single command simply by adding them to the list.

If you want to track CPU usage alongside available RAM (Memory), you run:

typeperf "\Processor(_Total)\% Processor Time" "\Memory\Available MBytes"

The terminal will now output two distinct columns of data on every line, allowing you to see exactly how a spike in CPU usage correlates to a drop in available Memory.

Step 5: Exporting Data for Excel

The true power of typeperf is its ability to log data to a file unattended. If you need to monitor a server over the weekend, you do not want the data just flashing on the screen; you need it saved to a CSV file so you can graph it in Excel on Monday morning.

You can use the -f flag to define the file format (CSV), the -o flag to define the output file location, and the -si flag to define the sample interval in seconds (e.g., checking every 60 seconds instead of every 1 second to save disk space).

typeperf "\Processor(_Total)\% Processor Time" -si 60 -f CSV -o C:\server_log.csv

The terminal will go completely silent, but every 60 seconds, it is silently appending a new row of data to that CSV file. When you return on Monday, you simply press Ctrl+C to kill the monitor, open the CSV in Excel, and instantly generate a beautiful line graph proving exactly what happened to the server at 3:00 AM.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.