Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TimeFilter.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 sw=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file protocols/filters/TimeFilter.cc
11 /// @author Sarel Fleishman (sarelf@uw.edu)
12 
15 
16 // Project Headers
17 #include <core/types.hh>
18 // AUTO-REMOVED #include <core/pose/Pose.hh>
19 
20 //parsing
21 // AUTO-REMOVED #include <utility/tag/Tag.hh>
23 #include <basic/Tracer.hh>
24 // AUTO-REMOVED #include <time.h>
25 
26 #include <utility/vector0.hh>
27 #include <utility/vector1.hh>
28 
29 
30 namespace protocols {
31 namespace filters {
32 
33 static basic::Tracer TR( "protocols.filters.TimeFilter" );
34 
35 ///@brief default ctor
37  Filter( "Time" ),
38  tic_( 0 ),
39  toc_( 0 )
40 {}
41 
43 
46 {
47  if( tic_ == 0 ){
48  tic_ = time( NULL );
49  }
50  else{
51  toc_ = time( NULL );
52  return toc_ - tic_;
53  }
54  return 0;
55 }
56 
59 {
60  core::Real const elapsed_time( toc_ - tic_ );
61  return( elapsed_time );
62 }
63 
64 void
65 TimeFilter::report( std::ostream &out, core::pose::Pose const & ) const
66 {
67  core::Real const elapsed_time( toc_ - tic_ );
68  out<<elapsed_time<<" seconds"<<std::endl;
69 }
70 
75  core::pose::Pose const &)
76 {
77 }
78 
79 bool
81  compute( p );
82  return true;
83 }
84 
87 
89 TimeFilterCreator::keyname() const { return "Time"; }
90 
91 } // filters
92 } // protocols