Prusa3d Marlin fork
Static Public Member Functions | List of all members
Stopwatch Class Reference

Stopwatch class. More...

#include <stopwatch.h>

Static Public Member Functions

static FORCE_INLINE void init ()
 Initialize the stopwatch.
 
static bool stop ()
 Stop the stopwatch. More...
 
static bool abort ()
 
static bool pause ()
 Pause the stopwatch. More...
 
static bool start ()
 Start the stopwatch. More...
 
static void resume (const uint32_t with_time)
 Resume the stopwatch. More...
 
static void reset ()
 Reset the stopwatch. More...
 
static FORCE_INLINE bool isRunning ()
 Check if the timer is running. More...
 
static FORCE_INLINE bool isPaused ()
 Check if the timer is paused. More...
 
static uint32_t duration ()
 Get the running time. More...
 

Detailed Description

NOTE: this file has been changed in order to compile & run on Prusa-Firmware https://github.com/prusa3d/Prusa-Firmware

Marlin 3D Printer Firmware Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]

Based on Sprinter and grbl. Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

This class acts as a timer proving stopwatch functionality including the ability to pause the running time counter.

Member Function Documentation

◆ duration()

uint32_t Stopwatch::duration ( )
static

Return the total number of seconds the timer has been running.

Returns
the delta since starting the stopwatch

◆ isPaused()

static FORCE_INLINE bool Stopwatch::isPaused ( )
inlinestatic

Return true if the timer is currently paused, false otherwise.

Returns
true if stopwatch is paused

◆ isRunning()

static FORCE_INLINE bool Stopwatch::isRunning ( )
inlinestatic

Return true if the timer is currently running, false otherwise.

Returns
true if stopwatch is running

◆ pause()

bool Stopwatch::pause ( )
static

Pause the running timer, it will silently ignore the request if no timer is currently running.

Returns
true on success

◆ reset()

void Stopwatch::reset ( )
static

Reset all settings to their default values.

◆ resume()

void Stopwatch::resume ( const uint32_t  with_time)
static

Resume a timer from a given duration

◆ start()

bool Stopwatch::start ( )
static

Start the timer, it will silently ignore the request if the timer is already running.

Returns
true on success

◆ stop()

bool Stopwatch::stop ( )
static

Stop the running timer, it will silently ignore the request if no timer is currently running.

Returns
true on success

The documentation for this class was generated from the following files: