summaryrefslogtreecommitdiff
path: root/content/posts/code_test.md
diff options
context:
space:
mode:
Diffstat (limited to 'content/posts/code_test.md')
-rw-r--r--content/posts/code_test.md20
1 files changed, 16 insertions, 4 deletions
diff --git a/content/posts/code_test.md b/content/posts/code_test.md
index be9b5cd..761c536 100644
--- a/content/posts/code_test.md
+++ b/content/posts/code_test.md
@@ -1,13 +1,14 @@
+++
-title="Test code syntax highlight"
-date=2020-10-13
-draft=false
+title = "Test code syntax highlight"
+date = 2020-10-13
+draft = false
[taxonomies]
-tags=["test", "code"]
+tags = ["test", "code"]
[extra]
disable_comments = true
+toc = false
+++
```rust
@@ -22,3 +23,14 @@ fn factorial(n: u64) -> u64 {
```typescript
const sum = (n: number) => n * (n + 1) / 2
```
+
+```python
+### multi-threading
+
+import os ; n_cores = os.cpu_count() // 2 ;
+
+from concurrent.futures import ThreadPoolExecutor
+
+with ThreadPoolExecutor(max_workers=n_cores) as executor:
+ executor.map(render, range(0, len(image_array)))
+```