ip-tools 0.2.0

A CLI tool and library to retrieve the local IP address and list network interfaces
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use criterion::{criterion_group, criterion_main, Criterion};
use ip_tools::{get_local_ip, list_net_ifs};

fn bench_get_local_ip(c: &mut Criterion) {
    c.bench_function("get_local_ip", |b| {
        b.iter(get_local_ip);
    });
}

fn bench_list_net_ifs(c: &mut Criterion) {
    c.bench_function("list_net_ifs", |b| {
        b.iter(list_net_ifs);
    });
}

criterion_group!(benches, bench_get_local_ip, bench_list_net_ifs);
criterion_main!(benches);