Logo Search packages:      
Sourcecode: ultracopier version File versions  Download package

QString copyThread::getCopySpeed (  ) [slot]

get copy speed in byte per second

Returns:
Return the speed in byte per second

Definition at line 662 of file CopyThread.cpp.

References intervalCopySpeed, intToQtringSize(), previousSizeReturned, and totalCopiedSize.

{
      //for have fixed value (not change durring copy)
      qint64 totalCopiedSize=this->totalCopiedSize;
      //for calcul copied size
      qint64 returnedValue=totalCopiedSize-previousSizeReturned;
      if(returnedValue==0)
            return "0B/s";
      //get elapsed time
      int timeFromNextRestart=intervalCopySpeed.elapsed();
      if(timeFromNextRestart<=0)
            return "";
      else
      {
            returnedValue=(returnedValue*1000/timeFromNextRestart);
            intervalCopySpeed.restart();
      }
      previousSizeReturned=totalCopiedSize;
      return intToQtringSize(returnedValue)+"/s";
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index