Skip to content

Commit

Permalink
Merge pull request #20 from oiwn/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
oiwn authored Dec 25, 2023
2 parents ea07ad0 + 7ac0b83 commit 1f0c8b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tarts" # shortcut from Terminal Arts
version = "0.1.4"
version = "0.1.5"
edition = "2021"

authors = ["oiwn <[email protected]>"]
Expand Down
4 changes: 3 additions & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ where

// stabilize fps if requred
let ended_at = std::time::SystemTime::now();
let delta = ended_at.duration_since(started_at).unwrap();
let delta = ended_at
.duration_since(started_at)
.unwrap_or(std::time::Duration::from_secs(0));
if delta < target_frame_duration {
std::thread::sleep(target_frame_duration - delta);
};
Expand Down

0 comments on commit 1f0c8b1

Please sign in to comment.