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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! The `console.count` and `console.countReset` functions allow you to run a counter
//! amd log it to the browser's developer tools console. You
//! call `console.count("foo")` when the counter begins, and call
//! `console.countReset("foo")` when it is to be reset.
//!
//! [See MDN for more info](https://developer.mozilla.org/en-US/docs/Web/API/Console/count).
//!
//! This API wraps both the `count` and `countReset` calls into a single type
//! named `Counter`, ensuring both are called.
//!
//! The counter is started with
//!
//! ```no_run
//! use gloo_console::Counter;
//!
//! let counter = Counter::new("foo");
//!
//! counter.count();
//! counter.count();
//! ```
use console;
/// A console time measurement.
///
/// Dropping this will reset the counter to 0.