Cleanup: Remove iostreams include from timeit header

Continuation of #110986

Pull Request: https://projects.blender.org/blender/blender/pulls/111010
This commit is contained in:
Iliya Katueshenock 2023-11-13 10:42:29 +01:00 committed by Hans Goudey
parent df960e5fc3
commit 4f03d502e6
12 changed files with 31 additions and 10 deletions

View File

@ -6,6 +6,8 @@
* \ingroup bke
*/
#include <iostream>
#include "BKE_anim_data.h"
#include "BKE_curves.hh"
#include "BKE_customdata.h"

View File

@ -6,6 +6,8 @@
* \ingroup bke
*/
#include <iostream>
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"

View File

@ -5,7 +5,6 @@
#pragma once
#include <chrono>
#include <iostream>
#include <string>
#include "BLI_sys_types.h"
@ -29,15 +28,7 @@ class ScopedTimer {
start_ = Clock::now();
}
~ScopedTimer()
{
const TimePoint end = Clock::now();
const Nanoseconds duration = end - start_;
std::cout << "Timer '" << name_ << "' took ";
print_duration(duration);
std::cout << '\n';
}
~ScopedTimer();
};
class ScopedTimerAveraged {

View File

@ -2,6 +2,8 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include <iostream>
#include "BLI_generic_virtual_array.hh"
namespace blender {

View File

@ -2,6 +2,7 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include <iostream>
#include <mutex>
#include "BLI_array.hh"

View File

@ -6,6 +6,7 @@
#include <algorithm>
#include <iomanip>
#include <iostream>
namespace blender::timeit {
@ -31,6 +32,16 @@ void print_duration(Nanoseconds duration)
}
}
ScopedTimer::~ScopedTimer()
{
const TimePoint end = Clock::now();
const Nanoseconds duration = end - start_;
std::cout << "Timer '" << name_ << "' took ";
print_duration(duration);
std::cout << '\n';
}
ScopedTimerAveraged::~ScopedTimerAveraged()
{
const TimePoint end = Clock::now();

View File

@ -34,6 +34,8 @@
* they share common sub-fields and a common context.
*/
#include <iostream>
#include "BLI_function_ref.hh"
#include "BLI_generic_virtual_array.hh"
#include "BLI_string_ref.hh"

View File

@ -6,6 +6,8 @@
* \ingroup ply
*/
#include <iostream>
#include "BLI_timeit.hh"
#include "DNA_windowmanager_types.h"

View File

@ -6,6 +6,8 @@
* \ingroup stl
*/
#include <iostream>
#include "BKE_customdata.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"

View File

@ -2,6 +2,8 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include <iostream>
#include "usd.h"
#include "usd.hh"
#include "usd_hierarchy_iterator.h"

View File

@ -6,6 +6,8 @@
* \ingroup obj
*/
#include <iostream>
#include "BLI_path_util.h"
#include "BLI_timeit.hh"

View File

@ -6,6 +6,8 @@
* \ingroup obj
*/
#include <iostream>
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_scene_types.h"