aboutsummaryrefslogtreecommitdiff
path: root/server/src/state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/state.rs')
-rw-r--r--server/src/state.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/src/state.rs b/server/src/state.rs
index 28ef7235..1e01036c 100644
--- a/server/src/state.rs
+++ b/server/src/state.rs
@@ -23,11 +23,19 @@ use anyhow::Result;
use hurrycurry_locale::{TrError, tre, trm};
use hurrycurry_protocol::{Menu, Message, PacketC, PacketS, PlayerID, VERSION};
use log::{debug, info, trace};
+use std::time::{Duration, Instant};
impl Server {
pub fn tick_outer(&mut self, dt: f32) -> anyhow::Result<()> {
if !self.paused {
+ let start = Instant::now();
let r = self.tick(dt);
+ self.tick_perf.0 += start.elapsed();
+ self.tick_perf.1 += 1;
+ if self.tick_perf.1 >= 500 {
+ debug!("tick perf {:?}", self.tick_perf.0 / 500);
+ self.tick_perf = (Duration::ZERO, 0);
+ }
if let Some((name, timer)) = r {
self.scoreboard.save()?;
self.load(self.index.generate_with_book(&name)?, timer);