mirror of
https://github.com/Wessel/nhl-levenshtein.git
synced 2026-07-23 08:47:31 +02:00
feat: Add console app to measure CPU and Memory performance
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user