Skip to content

Commit

Permalink
cleanup: turn .microseconds() ... us to .microseconds() ... µs (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman committed Jan 20, 2024
1 parent d744314 commit 856984a
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
Expand Up @@ -11,7 +11,7 @@ fn timed_println(msg string) {
}

fn timed_println_extended(t time.StopWatch, msg string) {
println('${t.elapsed().microseconds():12} | ${msg}')
println('${t.elapsed().microseconds():12} µs | ${msg}')
}

fn f(x big.Integer, y int) big.Integer {
Expand Down
2 changes: 1 addition & 1 deletion vlib/net/http/file/folder_index.v
Expand Up @@ -17,7 +17,7 @@ fn get_folder_index_html(requested_file_path string, uri_path string, filter_mye
write_page_header(mut sb, uri_path)
write_page_crumbs(mut sb, uri_path)
write_page_table(mut sb, uri_path, requested_file_path, mut files)
sb.writeln('<p>Server time: <b>${time.now().format_ss()}</b>, generated in <b>${sw.elapsed().microseconds():6} us</b></p>')
sb.writeln('<p>Server time: <b>${time.now().format_ss()}</b>, generated in <b>${sw.elapsed().microseconds():6}µs</b></p>')
write_page_footer(mut sb, uri_path)
return sb.str()
}
Expand Down
2 changes: 1 addition & 1 deletion vlib/net/http/file/static_server.v
Expand Up @@ -58,7 +58,7 @@ fn (mut h StaticHttpHandler) handle(req http.Request) http.Response {
mut res := http.new_response(body: '')
sw := time.new_stopwatch()
defer {
log.info('took: ${sw.elapsed().microseconds():6} us, status: ${res.status_code}, size: ${res.body.len:9}, url: ${req.url}')
log.info('took: ${sw.elapsed().microseconds():6}µs, status: ${res.status_code}, size: ${res.body.len:9}, url: ${req.url}')
}
mut uri_path := req.url.all_after_first('/').trim_right('/')
requested_file_path := os.norm_path(os.real_path(os.join_path_single(h.params.folder,
Expand Down
2 changes: 1 addition & 1 deletion vlib/v2/builder/builder.v
Expand Up @@ -67,5 +67,5 @@ fn (mut b Builder) gen_v_files() {
}

fn print_time(title string, time_d time.Duration) {
println(' * ${title}: ${time_d.milliseconds()}ms (${time_d.microseconds()}us)')
println(' * ${title}: ${time_d.milliseconds()}ms (${time_d.microseconds()}µs)')
}
2 changes: 1 addition & 1 deletion vlib/v2/gen/v/gen.v
Expand Up @@ -63,7 +63,7 @@ pub fn (mut g Gen) gen(file ast.File) {
g.stmt_list(g.file.stmts)
if g.pref.verbose {
gen_time := sw.elapsed()
println('gen (v) ${file.name}: ${gen_time.milliseconds()}ms (${gen_time.microseconds()}us)')
println('gen (v) ${file.name}: ${gen_time.milliseconds()}ms (${gen_time.microseconds()}µs)')
}
}

Expand Down
2 changes: 1 addition & 1 deletion vlib/v2/parser/parser.v
Expand Up @@ -125,7 +125,7 @@ pub fn (mut p Parser) parse_file(filename string, mut file_set token.FileSet) as
}
if p.pref.verbose {
parse_time := sw.elapsed()
println('scan & parse ${filename} (${p.file.line_count()} LOC): ${parse_time.milliseconds()}ms (${parse_time.microseconds()}us)')
println('scan & parse ${filename} (${p.file.line_count()} LOC): ${parse_time.milliseconds()}ms (${parse_time.microseconds()}µs)')
}
return ast.File{
attributes: attributes
Expand Down
2 changes: 1 addition & 1 deletion vlib/v2/types/checker.v
Expand Up @@ -159,7 +159,7 @@ pub fn (mut c Checker) check_file(file ast.File) {
}
if c.pref.verbose {
check_time := sw.elapsed()
println('type check ${file.name}: ${check_time.milliseconds()}ms (${check_time.microseconds()}us)')
println('type check ${file.name}: ${check_time.milliseconds()}ms (${check_time.microseconds()}µs)')
}
}

Expand Down

0 comments on commit 856984a

Please sign in to comment.