feat: Add console app to measure CPU and Memory performance

This commit is contained in:
2025-03-20 10:06:04 +01:00
parent 7734f3c60b
commit 7d4fb4e617
3 changed files with 18 additions and 7 deletions

View File

@@ -1,3 +1,5 @@
using LevenshteinRatio; using LevenshteinRatio;
Console.WriteLine(Levenshtein.Ratio("exampel", "example")); for (int i = 0; i < 1000000; i++) {
Console.WriteLine(i + Levenshtein.Ratio("test", "kitten"));
}

View File

@@ -5,9 +5,13 @@ import Text.Format
main :: IO () main :: IO ()
main = do main = do
let source = "kitten" repeatNTimes
target = "sitting" 1000000
(putStrLn
putStrLn $ format "Source\t{0}" [source] (format "{0}" [show (levenshteinRatio "test" "kitten")])
putStrLn $ format "Target\t{0}" [target] )
putStrLn $ format "Ratio\t{0}" [show (levenshteinRatio source target)] where
repeatNTimes 0 _ = return ()
repeatNTimes n action = do
action
repeatNTimes (n-1) action

5
Typescript/console.ts Normal file
View File

@@ -0,0 +1,5 @@
import { levenshteinRatio } from "./levenshteinRatio.ts";
for (let i = 0; i < 1000000; i++) {
console.log(levenshteinRatio('test', 'kitten'));
}