1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
extern crate ljmrs;

use std::time::Instant;
use ljmrs::LJMWrapper;

fn load() {
    let now = Instant::now();

    let ljm_wrapper = unsafe { LJMWrapper::init() }.unwrap();

    let open_call = ljm_wrapper.open_jack(
        ljmrs::DeviceType::ANY,
        ljmrs::ConnectionType::ANY,
       "-2".to_string(),
    ).expect("Could not open DEMO LabJack");

    println!("Opened LabJack, got handle: {}", open_call);

    let elapsed = now.elapsed();
    println!("Elapsed: {:.2?}", elapsed);

    let now = Instant::now();

    let (addr, typ) = ljm_wrapper.name_to_address("TEST_INT32".to_string()).expect("Expected NTA");
    println!("TEST_INT32 => Address: {}, Type: {}", addr, typ);

    let elapsed = now.elapsed();
    println!("Elapsed: {:.2?}", elapsed);
}

fn main() {
    load();
}