MCPcopy Create free account
hub / github.com/apple/foundationdb / secondsToTimeFormat

Function secondsToTimeFormat

fdbclient/FileBackupAgent.actor.cpp:82–91  ·  view source on GitHub ↗

Time format : <= 59 seconds <= 59.99 minutes <= 23.99 hours N.NN days

Source from the content-addressed store, hash-verified

80// <= 23.99 hours
81// N.NN days
82std::string secondsToTimeFormat(int64_t seconds) {
83 if (seconds >= 86400)
84 return format("%.2f day(s)", seconds / 86400.0);
85 else if (seconds >= 3600)
86 return format("%.2f hour(s)", seconds / 3600.0);
87 else if (seconds >= 60)
88 return format("%.2f minute(s)", seconds / 60.0);
89 else
90 return format("%lld second(s)", seconds);
91}
92
93const Key FileBackupAgent::keyLastRestorable = LiteralStringRef("last_restorable");
94

Callers 1

string> getStatusMethod · 0.85

Calls 1

formatFunction · 0.50

Tested by

no test coverage detected