Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Side by Side Diff: tools/gn/command_gen.cc

Issue 1651113002: Use ElapsedTimer to measure VS files generation time in GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/atomicops.h" 5 #include "base/atomicops.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/timer/elapsed_timer.h" 10 #include "base/timer/elapsed_timer.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 errors_found), DECORATION_YELLOW); 145 errors_found), DECORATION_YELLOW);
146 } 146 }
147 return false; 147 return false;
148 } 148 }
149 149
150 bool RunIdeWriter(const std::string& ide, 150 bool RunIdeWriter(const std::string& ide,
151 const BuildSettings* build_settings, 151 const BuildSettings* build_settings,
152 Builder* builder, 152 Builder* builder,
153 Err* err) { 153 Err* err) {
154 if (ide == kSwitchIdeValueVs) { 154 if (ide == kSwitchIdeValueVs) {
155 base::TimeTicks begin_vs_gen = base::TimeTicks::Now(); 155 base::ElapsedTimer timer;
156 bool res = 156 bool res =
157 VisualStudioWriter::RunAndWriteFiles(build_settings, builder, err); 157 VisualStudioWriter::RunAndWriteFiles(build_settings, builder, err);
158 if (res && 158 if (res &&
159 !base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kQuiet)) { 159 !base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kQuiet)) {
160 OutputString( 160 OutputString("Generating Visual Studio projects took " +
161 "Generating Visual Studio projects took " + 161 base::Int64ToString(timer.Elapsed().InMilliseconds()) +
162 base::Int64ToString( 162 "ms\n");
163 (base::TimeTicks::Now() - begin_vs_gen).InMilliseconds()) +
164 "ms\n");
165 } 163 }
166 return res; 164 return res;
167 } 165 }
168 166
169 *err = Err(Location(), "Unknown IDE: " + ide); 167 *err = Err(Location(), "Unknown IDE: " + ide);
170 return false; 168 return false;
171 } 169 }
172 170
173 } // namespace 171 } // namespace
174 172
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 setup->scheduler().input_file_manager()->GetInputFileCount()) + 259 setup->scheduler().input_file_manager()->GetInputFileCount()) +
262 " files in " + 260 " files in " +
263 base::Int64ToString(elapsed_time.InMilliseconds()) + "ms\n"; 261 base::Int64ToString(elapsed_time.InMilliseconds()) + "ms\n";
264 OutputString(stats); 262 OutputString(stats);
265 } 263 }
266 264
267 return 0; 265 return 0;
268 } 266 }
269 267
270 } // namespace commands 268 } // namespace commands
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698