display used time to shred drive

This commit is contained in:
2022-05-11 23:45:05 +02:00
parent 818e78796d
commit 48bbad914f
7 changed files with 53 additions and 10 deletions

View File

@ -52,10 +52,11 @@ string Drive::sCapacityToText()
double dSize = (double) getCapacity();
uint16_t u16UnitIndex = 0;
const char* units[] = {"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"};
while (dSize >= 1000) { //using the marketing capacity
dSize /= 1000;
u16UnitIndex++;
}
while (dSize >= 1000) //using the marketing capacity
{
dSize /= 1000;
u16UnitIndex++;
}
sprintf(acBuffer, "%.*f %s", u16UnitIndex-3, dSize, units[u16UnitIndex]);
return acBuffer;
@ -139,6 +140,16 @@ void Drive::setTimestamp()
time(&this->u32Timestamp);
}
void Drive::setActionStartTimestamp()
{
time(&this->u32TimestampTaskStart);
}
time_t Drive::getActionStartTimestamp()
{
return this->u32TimestampTaskStart;
}
void Drive::checkFrozenDrive(void)
{
time_t u32localtime;