calculate delta time
fix merge conflicts and fix build on linux