# thread-amount [![Crate Version](https://img.shields.io/crates/v/thread-amount)](https://crates.io/crates/thread-amount) [![Documentation](https://docs.rs/thread-amount/badge.svg)](https://docs.rs/thread-amount) [![License](https://img.shields.io/crates/l/thread-amount.svg)](./LICENSE-APACHE) [![Continuous Delivery](https://github.com/devtomio/thread-amount/actions/workflows/continuous-delivery.yml/badge.svg)](https://github.com/devtomio/thread-amount/actions/workflows/continuous-delivery.yml) [![Continuous Integration](https://github.com/devtomio/thread-amount/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/devtomio/thread-amount/actions/workflows/continuous-integration.yml) **Get the amount of threads in the current process** ## Example Usage `Cargo.toml` ```toml [dependencies] thread-amount = "0.1" ``` The code: ```rust use thread_amount::thread_amount; use std::thread; fn main() { let amount = thread_amount(); thread::spawn(move || { assert_eq!(amount.map(NonZeroUsize::get), Some(1)) }); } ``` ## Difference between [`num-threads`](https://crates.io/crates/num-threads) This crate has windows support and reads the `/proc/[PID]/status` file in `-unix` systems. ## Contributors ✨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

Tomio

💻 📖 💡 🚇 🚧
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! ## License Licensed under the MIT license ([LICENSE](LICENSE) or )