Documentation - LibraryTime

223 views

Published on

Class that performs verification of elapsed time for performing certain tasks. Used to make the analysis of computational complexity compared to how long a particular snippet consuming to perform. The return is given in milliseconds based on the clock of the machine.

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
223
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Documentation - LibraryTime

  1. 1. Reference Manual Generated by Doxygen 1.6.3 Sun Dec 4 13:27:43 2011
  2. 2. Contents 1 1 1.1 2 Class Index 1 Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.1 3 File Index 3 File List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Class Documentation 5 3.1 LibraryTime Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.1.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . 5 3.1.2.1 LibraryTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.1.2.2 ∼LibraryTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.3.1 Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.3.2 Get . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.3.3 Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.3.4 Stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.1.3 4 File Documentation 9 4.1 LibraryTime.cxx File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4.2 LibraryTime.cxx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4.3 LibraryTime.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.4 LibraryTime.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.5 Sys-LibraryTime.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.5.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.5.1.1 main . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Sys-LibraryTime.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.6
  3. 3. Chapter 1 Class Index 1.1 Class List Here are the classes, structs, unions and interfaces with brief descriptions: LibraryTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
  4. 4. Chapter 2 File Index 2.1 File List Here is a list of all files with brief descriptions: LibraryTime.cxx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . LibraryTime.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sys-LibraryTime.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 11 13
  5. 5. Chapter 3 Class Documentation 3.1 LibraryTime Class Reference #include <LibraryTime.h> Public Member Functions • LibraryTime () • void Start (void) • void Stop (void) • double Get (void) • void Delay (const int miliseconds) • virtual ∼LibraryTime () 3.1.1 Detailed Description Classe que executa verificação de tempo decorrido para realização de determinadas tarefas. Usada para fazer análise de complexidade computacional em relação a quanto tempo um determinado trecho de código consome para ser realizado. O retorno é dado em milisegundos com base no clock da máquina. Definition at line 19 of file LibraryTime.h. 3.1.2 Constructor & Destructor Documentation 3.1.2.1 LibraryTime::LibraryTime () [inline] Método construtor da classe. Definition at line 35 of file LibraryTime.h. 00035 {};
  6. 6. 6 3.1.2.2 Class Documentation virtual LibraryTime::∼LibraryTime () [inline, virtual] Método destrutor da classe responsável por desalocar quaisquer recursos previamente alocados retornando os mesmos ao sistema. Definition at line 66 of file LibraryTime.h. 00066 {}; 3.1.3 Member Function Documentation 3.1.3.1 void LibraryTime::Delay (const int miliseconds) [inline] Método que imprime uma pausa em milisegundos na execução do fluxo do programa a partir do ponto onde ela foi chamada. Definition at line 59 of file LibraryTime.h. 00060 { clock_t exit_time = clock() + miliseconds; while(clock() <= exit_time); } 3.1.3.2 double LibraryTime::Get (void) [inline] Método responsável por retornar o intervalo em milisegundos decorrido entre as chamadas dos método Start() e Stop() Definition at line 53 of file LibraryTime.h. 00053 { return double( stop - start )/CLOCKS_PER_SEC; } Here is the caller graph for this function: LibraryTime::Get 3.1.3.3 main void LibraryTime::Start (void) [inline] Método responsável por capturar o tempo ou intervalo inicial de execução de alguma operação. Definition at line 41 of file LibraryTime.h. 00041 { start = clock(); } Here is the caller graph for this function: LibraryTime::Start main Generated on Sun Dec 4 13:27:43 2011 by Doxygen
  7. 7. 3.1 LibraryTime Class Reference 3.1.3.4 7 void LibraryTime::Stop (void) [inline] Método responsável por capturar o tempo ou intervalo de interrupção de execução de alguma operação. Definition at line 47 of file LibraryTime.h. 00047 { stop = clock(); } Here is the caller graph for this function: LibraryTime::Stop main The documentation for this class was generated from the following file: • LibraryTime.h Generated on Sun Dec 4 13:27:43 2011 by Doxygen
  8. 8. 8 Class Documentation Generated on Sun Dec 4 13:27:43 2011 by Doxygen
  9. 9. Chapter 4 File Documentation 4.1 LibraryTime.cxx File Reference #include "LibraryTime.h" #include <ctime> Include dependency graph for LibraryTime.cxx: LibraryTime.cxx ctime This graph shows which files directly or indirectly include this file: LibraryTime.cxx
  10. 10. 10 4.2 File Documentation LibraryTime.cxx 00001 /* 00002 * TimeInterval.cpp 00003 * 00004 * Created on: 26/10/2009 00005 * Author: Michel Alves dos Santos 00006 */ 00007 00008 #include "LibraryTime.h" 00009 00010 Generated on Sun Dec 4 13:27:43 2011 by Doxygen
  11. 11. 4.3 LibraryTime.h File Reference 4.3 11 LibraryTime.h File Reference #include <ctime> Include dependency graph for LibraryTime.h: LibraryTime.h ctime This graph shows which files directly or indirectly include this file: LibraryTime.h Sys-LibraryTime.cpp Classes • class LibraryTime Generated on Sun Dec 4 13:27:43 2011 by Doxygen
  12. 12. 12 4.4 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00019 00020 00024 00025 00029 00030 00031 00035 00036 00041 00042 00047 00048 00053 00054 00059 00060 00061 00066 00067 00068 00069 File Documentation LibraryTime.h /* * TimeInterval.h * * Created on: 26/10/2009 Author: Michel Alves dos Santos * */ #ifndef LIBRARYTIME_H_ #define LIBRARYTIME_H_ #include <ctime> class LibraryTime { clock_t start; clock_t stop; public: LibraryTime() {}; void Start(void) { start = clock(); } void Stop(void) { stop = clock(); } double Get(void) { return double( stop - start )/CLOCKS_PER_SEC; } void Delay(const int miliseconds) { clock_t exit_time = clock() + miliseconds; while(clock() <= exit_time); } virtual ~LibraryTime() {}; }; #endif /* LIBRARYTIME_H_ */ Generated on Sun Dec 4 13:27:43 2011 by Doxygen
  13. 13. 4.5 Sys-LibraryTime.cpp File Reference 4.5 13 Sys-LibraryTime.cpp File Reference #include <iostream> #include "LibraryTime.h" Include dependency graph for Sys-LibraryTime.cpp: Sys-LibraryTime.cpp iostream LibraryTime.h ctime Functions • int main (int argc, char ∗argv[ ]) 4.5.1 Function Documentation 4.5.1.1 int main (int argc, char ∗ argv[ ]) Função para testes com a biblioteca. Definition at line 13 of file Sys-LibraryTime.cpp. 00014 { 00015 //Declaração de um objeto do tipo LibraryTime 00016 LibraryTime t; 00017 00018 //Inicio da captura de tempo 00019 t.Start(); 00020 00021 //Mensagem de teste. 00022 std::cout << "!!!Hello World!!!" << std::endl; 00023 00024 //Término da captura de tempo 00025 t.Stop(); 00026 00027 //Tempo consumido para execução do programa 00028 std::cout << "Tempo consumido: " << t.Get() << std::endl; 00029 return 0; 00030 } Here is the call graph for this function: LibraryTime::Get main LibraryTime::Start LibraryTime::Stop Generated on Sun Dec 4 13:27:43 2011 by Doxygen
  14. 14. 14 4.6 00001 00002 00003 00004 00005 00006 00007 00008 00009 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 File Documentation Sys-LibraryTime.cpp //============================================================================ // Name : LibraryTime // Author : Michel Alves dos Santos // Version : 1.0 beta //============================================================================ #include <iostream> #include "LibraryTime.h" int main(int argc, char* argv[]) { //Declaração de um objeto do tipo LibraryTime LibraryTime t; //Inicio da captura de tempo t.Start(); //Mensagem de teste. std::cout << "!!!Hello World!!!" << std::endl; //Término da captura de tempo t.Stop(); //Tempo consumido para execução do programa std::cout << "Tempo consumido: " << t.Get() << std::endl; return 0; } Generated on Sun Dec 4 13:27:43 2011 by Doxygen
  15. 15. Index ∼LibraryTime LibraryTime, 5 Delay LibraryTime, 6 Get LibraryTime, 6 LibraryTime, 5 ∼LibraryTime, 5 Delay, 6 Get, 6 LibraryTime, 5 Start, 6 Stop, 6 LibraryTime.cxx, 9 LibraryTime.h, 11 main Sys-LibraryTime.cpp, 13 Start LibraryTime, 6 Stop LibraryTime, 6 Sys-LibraryTime.cpp, 13 main, 13

×