nnlib
GPU-accelerated, C/C++ neural network library.
Functions
printing.h File Reference

Header file declaring methods to construct useful string messages. More...

#include <string>

Go to the source code of this file.

Functions

std::string constructProgressBar (size_t currentStep, size_t maxSteps)
 Construct a string message representing a progress bar. More...
 
std::string constructPercentage (size_t currentStep, size_t maxSteps)
 Construct a string message about progress in percentage form. More...
 
std::string constructTime (size_t milliseconds)
 Construct a string message displaying current time spent. More...
 

Detailed Description

Header file declaring methods to construct useful string messages.

Author
Jan Warchocki
Date
05 April 2022

Function Documentation

◆ constructPercentage()

std::string constructPercentage ( size_t  currentStep,
size_t  maxSteps 
)

Construct a string message about progress in percentage form.

The info is displayed in the following format:

[25/50 (50%)]
Parameters
currentStepThe current progress to display.
maxStepsThe maximum progress that can be achieved.
Returns
A string representing the percentage.

◆ constructProgressBar()

std::string constructProgressBar ( size_t  currentStep,
size_t  maxSteps 
)

Construct a string message representing a progress bar.

The progress bar is displayed in the following format:

[==============>-----]
Parameters
currentStepThe current progress to display.
maxStepsThe maximum progress that can be achieved.
Returns
A string representing the progress bar.

◆ constructTime()

std::string constructTime ( size_t  milliseconds)

Construct a string message displaying current time spent.

The time is displayed in the following format:

(0h 2m 5s 127ms)
Parameters
millisecondsThe amount of time to display in milliseconds.
Returns
A string representing the time.