mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 22:30:03 -04:00
Add a fractal clock example to showcase painting performance
This commit is contained in:
@@ -7,6 +7,7 @@ edition = "2018"
|
||||
[dependencies]
|
||||
emigui = { path = "../emigui" }
|
||||
|
||||
chrono = { version = "0.4" }
|
||||
clipboard = "0.5"
|
||||
glium = "0.24"
|
||||
serde_json = "1"
|
||||
|
||||
@@ -195,3 +195,12 @@ pub fn write_memory(
|
||||
serde_json::to_writer_pretty(std::fs::File::create(memory_json_path)?, &*ctx.memory())?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/// Time of day as seconds since midnight. Used for clock in example app.
|
||||
pub fn local_time_of_day() -> f64 {
|
||||
use chrono::Timelike;
|
||||
let time = chrono::Local::now().time();
|
||||
time.num_seconds_from_midnight() as f64 + 1e-9 * (time.nanosecond() as f64)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user