https://github.com/tarc/timerbenchmark
This is a CMake skeleton for C# projects. It is also a kind of benchmark for Windows timer utilities.
https://github.com/tarc/timerbenchmark
cmake csharp skeleton
Last synced: 11 days ago
JSON representation
This is a CMake skeleton for C# projects. It is also a kind of benchmark for Windows timer utilities.
- Host: GitHub
- URL: https://github.com/tarc/timerbenchmark
- Owner: tarc
- Created: 2020-05-05T09:20:02.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-08T04:33:56.000Z (about 6 years ago)
- Last Synced: 2025-03-11T08:51:06.503Z (over 1 year ago)
- Topics: cmake, csharp, skeleton
- Language: C#
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TimerBenchmark
This is a CMake skeleton for C# projects. It is also a kind of benchmark for Windows timer utilities, based on [TimeSpan Calculation based on DateTime is a Performance Bottleneck](https://www.codeproject.com/Articles/800756/TimeSpan-Calculation-based-on-DateTime-is-a-Perfor).
## Clonning, Compiling and Running
Make sure you have CMake, Git and a C# toolchain properly installed and issue the following commands:
```batch
git clone https://github.com/tarc/TimerBenchmark.git
cd TimerBenchmark
run.bat
```
The expected output from the above commands is something like:
```text
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.17763.
-- The CSharp compiler identification is Microsoft unknown 9999
-- The CSharp compiler version is 9999
-- Check for working C# compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/MSBuild/Current/Bin/Roslyn/csc.exe
-- Check for working C# compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/MSBuild/Current/Bin/Roslyn/csc.exe - works
-- Generating timerbenchmark
-- Configuring done
-- Generating done
-- Build files have been written to: E:/projects/TimerBenchmark/build
Microsoft(R) Build Engine versão 16.5.0+d4cbfca49 para .NET Framework
Copyright (C) Microsoft Corporation. Todos os direitos reservados.
Checking Build System
timerbenchmark -> E:\projects\TimerBenchmark\build\Debug\timerbenchmark.exe
Performance Tests
Stopwatch Resolution (nS): 100
Reference Loop (NOP) Iterations: 1000000
Reference Loop (NOP) Elapsed Time (ms): 1,9908
Query Environment.TickCount
Query Environment.TickCount Elapsed Time (ms): 4,8561
Query DateTime.Now.Ticks
Query DateTime.Now.Ticks Elapsed Time (ms): 178,5078
Query Stopwatch.ElapsedTicks
Query Stopwatch.ElapsedTicks Elapsed Time (ms): 33,7396
Building Custom Rule E:/projects/TimerBenchmark/CMakeLists.txt
```