@@ -75,61 +75,55 @@ impl Debug {
7575 }
7676
7777 pub fn startup_finished ( & mut self ) {
78- self . startup_duration = time :: Instant :: now ( ) - self . startup_start ;
78+ self . startup_duration = self . startup_start . elapsed ( ) ;
7979 }
8080
8181 pub fn update_started ( & mut self ) {
8282 self . update_start = time:: Instant :: now ( ) ;
8383 }
8484
8585 pub fn update_finished ( & mut self ) {
86- self . update_durations
87- . push ( time:: Instant :: now ( ) - self . update_start ) ;
86+ self . update_durations . push ( self . update_start . elapsed ( ) ) ;
8887 }
8988
9089 pub fn view_started ( & mut self ) {
9190 self . view_start = time:: Instant :: now ( ) ;
9291 }
9392
9493 pub fn view_finished ( & mut self ) {
95- self . view_durations
96- . push ( time:: Instant :: now ( ) - self . view_start ) ;
94+ self . view_durations . push ( self . view_start . elapsed ( ) ) ;
9795 }
9896
9997 pub fn layout_started ( & mut self ) {
10098 self . layout_start = time:: Instant :: now ( ) ;
10199 }
102100
103101 pub fn layout_finished ( & mut self ) {
104- self . layout_durations
105- . push ( time:: Instant :: now ( ) - self . layout_start ) ;
102+ self . layout_durations . push ( self . layout_start . elapsed ( ) ) ;
106103 }
107104
108105 pub fn event_processing_started ( & mut self ) {
109106 self . event_start = time:: Instant :: now ( ) ;
110107 }
111108
112109 pub fn event_processing_finished ( & mut self ) {
113- self . event_durations
114- . push ( time:: Instant :: now ( ) - self . event_start ) ;
110+ self . event_durations . push ( self . event_start . elapsed ( ) ) ;
115111 }
116112
117113 pub fn draw_started ( & mut self ) {
118114 self . draw_start = time:: Instant :: now ( ) ;
119115 }
120116
121117 pub fn draw_finished ( & mut self ) {
122- self . draw_durations
123- . push ( time:: Instant :: now ( ) - self . draw_start ) ;
118+ self . draw_durations . push ( self . draw_start . elapsed ( ) ) ;
124119 }
125120
126121 pub fn render_started ( & mut self ) {
127122 self . render_start = time:: Instant :: now ( ) ;
128123 }
129124
130125 pub fn render_finished ( & mut self ) {
131- self . render_durations
132- . push ( time:: Instant :: now ( ) - self . render_start ) ;
126+ self . render_durations . push ( self . render_start . elapsed ( ) ) ;
133127 }
134128
135129 pub fn log_message < Message : std:: fmt:: Debug > ( & mut self , message : & Message ) {
0 commit comments