Skip to content

Commit 2067fe1

Browse files
committed
add elapsed time for Crystal
1 parent 6dd951f commit 2067fe1

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

words_extractor_cr/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@ TODO: Write installation instructions here
88

99
## Usage
1010

11-
TODO: Write usage instructions here
12-
11+
Build an optimized code with MT support
12+
```
13+
crystal build --release -Dpreview_mt src/fast_words_cr.cr -o main
14+
```
15+
16+
Run on 8 CPU cores:
17+
```
18+
CRYSTAL_WORKES=8 ./main
19+
```
1320
## Development
1421

1522
TODO: Write development instructions here

words_extractor_cr/src/fast_words_cr.cr

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require "yaml"
44
# TODO: Write documentation for `FastWordsCr`
55

66
module FastWordsCr
7-
VERSION = "0.1.0"
7+
VERSION = "0.2.0"
88
CHARSET = "aąbcćdeęfghijklłmnńoópqrsśtuvwxyzźż"
99

1010
def self.main(outpath = "words")
@@ -69,4 +69,7 @@ module FastWordsCr
6969
end
7070
end
7171

72-
FastWordsCr.main
72+
elapsed_time = Time.measure do
73+
FastWordsCr.main
74+
end
75+
puts elapsed_time

0 commit comments

Comments
 (0)