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

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