This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
const msgCount int = 10000 | |
const capacity int = 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use crossbeam::channel::{bounded, Receiver, Sender}; | |
use std::thread; | |
use std::time::{Duration, Instant}; | |
const MSG_COUNT: usize = 10_000; | |
const CAPACITY : usize = 100; | |
struct Message { | |
id: usize, | |
time_send: Instant, |