Skip to content

Commit d4d0dfe

Browse files
committed
refactor(example): update basic example
1 parent a6ad42e commit d4d0dfe

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

examples/basic.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,34 @@ fn main() -> Result<()> {
2020
.tags(&[("TagA", "ValueA"), ("TagB", "ValueB")])
2121
.build()?;
2222

23+
// Show start time
24+
let start = std::time::SystemTime::now()
25+
.duration_since(std::time::UNIX_EPOCH)
26+
.unwrap()
27+
.as_secs();
28+
println!("Start Time: {}", start);
29+
2330
// Start Agent
2431
agent.start()?;
2532

2633
let _result = fibonacci(47);
2734

35+
// Show stop time
36+
let stop = std::time::SystemTime::now()
37+
.duration_since(std::time::UNIX_EPOCH)
38+
.unwrap()
39+
.as_secs();
40+
println!("Stop Time: {}", stop);
41+
2842
// Stop Agent
2943
agent.stop()?;
3044

45+
// Show program exit time
46+
let exit = std::time::SystemTime::now()
47+
.duration_since(std::time::UNIX_EPOCH)
48+
.unwrap()
49+
.as_secs();
50+
println!("Exit Time: {}", exit);
51+
3152
Ok(())
3253
}

0 commit comments

Comments
 (0)