Skip to content

ythaw/System-Monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

SystemMonitor (Windows C++)

A small Windows systems-style monitoring tool written in C++ that samples CPU and memory usage and logs results to a CSV file.

What it does

  • Reads CPU utilization (%) using Windows GetSystemTimes (computed from time deltas).
  • Reads memory utilization (%) using Windows GlobalMemoryStatusEx.
  • Prints metrics to the console once per second.
  • Logs metrics to a CSV file: timestamp,cpu_percent,mem_percent.
  • Includes basic error handling so logging failures do not crash metric collection.
  • Runs until the user presses any key.

Project structure

  • src/
  • main.cpp
  • SystemMetrics.h/.cpp
  • Logger.h/.cpp
  • TimeUtil.h/.cpp

Build & run (Visual Studio)

  1. Open Visual Studio (C++ desktop development installed).
  2. Create a Console App (C++) project.
  3. Add the files from src/ into your project (Source Files + Header Files).
  4. Build and run.

Output

Console output (example):

2026-01-06 11:22:18 | CPU: 9.91% | MEM: 81.00%
2026-01-06 11:22:19 | CPU: 7.67% | MEM: 81.00%

Tech

  • C++ (Visual Studio / MSVC)
  • Windows API: GetSystemTimes, GlobalMemoryStatusEx

About

Monitors and logs device's cpu usage and memory usage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages