mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-22 20:40:18 +00:00
some fix
This commit is contained in:
parent
6681efe770
commit
6051652405
@ -26,8 +26,8 @@ namespace pkpy{
|
|||||||
if(lineno < 0) lineno = 0;
|
if(lineno < 0) lineno = 0;
|
||||||
const char* _start = line_starts.at(lineno);
|
const char* _start = line_starts.at(lineno);
|
||||||
const char* i = _start;
|
const char* i = _start;
|
||||||
// max 200 chars
|
// max 300 chars
|
||||||
while(*i != '\n' && *i != '\0' && i-_start < 200) i++;
|
while(*i != '\n' && *i != '\0' && i-_start < 300) i++;
|
||||||
return {_start, i};
|
return {_start, i};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,11 @@ Str LineProfiler::stats(){
|
|||||||
ss << left_pad(std::to_string(record.hits), 10);
|
ss << left_pad(std::to_string(record.hits), 10);
|
||||||
ss << left_pad(std::to_string(record.time), 13);
|
ss << left_pad(std::to_string(record.time), 13);
|
||||||
ss << left_pad(std::to_string(record.time / record.hits), 9);
|
ss << left_pad(std::to_string(record.time / record.hits), 9);
|
||||||
ss << left_pad(to_string_1f(record.time * (f64)100 / total_time), 9);
|
if(total_time == 0){
|
||||||
|
ss << left_pad("0.0", 9);
|
||||||
|
}else{
|
||||||
|
ss << left_pad(to_string_1f(record.time * (f64)100 / total_time), 9);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// line_content
|
// line_content
|
||||||
auto [_0, _1] = decl->code->src->_get_line(line);
|
auto [_0, _1] = decl->code->src->_get_line(line);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user