Mercurial > lbo > hg > myi3stat
changeset 20:d69c429b176c
Fix wrong now() calculation; added BTreeSet State enum
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Sun, 14 Feb 2016 17:53:51 +0100 |
parents | 9d7e78d13bd4 |
children | 229a4f04038c |
files | src/framework.rs |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/framework.rs Sun Feb 14 16:22:50 2016 +0100 +++ b/src/framework.rs Sun Feb 14 17:53:51 2016 +0100 @@ -1,6 +1,6 @@ #![allow(dead_code)] -use std::collections::BTreeMap; +use std::collections::{BTreeMap, BTreeSet}; use std::thread::sleep; use std::time::Duration; @@ -72,6 +72,7 @@ I(i64), F(f64), C(Color), + BTS(BTreeSet<String>), } /// State that is passed to and returned from every render cycle. @@ -100,7 +101,7 @@ pub fn now() -> i64 { use self::chrono::Timelike; let t = chron::Local::now(); - t.timestamp() + t.nanosecond() as i64 / 1000000 + 1000 * t.timestamp() + (t.nanosecond() as i64 / 1000000) } }