Skip to content
Snippets Groups Projects
Commit 2dde5ffb authored by mark's avatar mark
Browse files

ENH: use long for number of calls in profiling (issue #157)

- provide a static profiling::print(Ostream&) method to output
  values to a log file.
parent c4c12a0c
No related branches found
No related tags found
No related merge requests found
...@@ -73,6 +73,19 @@ bool Foam::profiling::active() ...@@ -73,6 +73,19 @@ bool Foam::profiling::active()
} }
bool Foam::profiling::print(Ostream& os)
{
if (pool_)
{
return pool_->writeData(os);
}
else
{
return false;
}
}
bool Foam::profiling::writeNow() bool Foam::profiling::writeNow()
{ {
if (pool_) if (pool_)
......
...@@ -190,14 +190,21 @@ protected: ...@@ -190,14 +190,21 @@ protected:
public: public:
// Member Functions // Static Member Functions
//- True if profiling is active //- True if profiling is active
static bool active(); static bool active();
//- Print profiling information to specified output
// Forwards to writeData member of top-level object
static bool print(Ostream&);
//- Write profiling information now //- Write profiling information now
static bool writeNow(); static bool writeNow();
// Member Functions
//- The owner of the profiling //- The owner of the profiling
const Time& owner() const; const Time& owner() const;
...@@ -248,7 +255,7 @@ class profiling::Information ...@@ -248,7 +255,7 @@ class profiling::Information
Information* parent_; Information* parent_;
//- Nr of times this was called //- Nr of times this was called
label calls_; long calls_;
//- Total time spent //- Total time spent
scalar totalTime_; scalar totalTime_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment