1) Does API class inherit QObject? If yes, it would be better to create signal in it. fro example, timeCahnged(double), and your code will like this:

Qt Code:
  1. myClass::myClass()
  2. {
  3. myapi = new API;
  4. mylabel = new QLabel;
  5. connect (myapi, SIGNAL ( timeCahnged(double) ), mylabel, SLOT (setNum(double) ) );
  6. }
To copy to clipboard, switch view to plain text mode 

2) Set value by QTimer

Qt Code:
  1. myClass::myClass()
  2. {
  3. myapi = new API;
  4. mylabel = new QLabel;
  5.  
  6. timer = new QTimer(this);
  7. connect(timer, SIGNAL(timeout()), this, SLOT(update()));
  8. }
  9.  
  10. int myClass::runapi()
  11. {
  12. // init API
  13.  
  14. timer->start(1000);
  15. }
  16.  
  17. void myClass::update ()
  18. {
  19. mylabel->setNum(myapi->mymethodelapsedtime());
  20. }
To copy to clipboard, switch view to plain text mode