| Filename | /home/hejohns/documentsNoSync/22f/490/gradescope-utils/lib/Gradescope/Color.pm |
| Statements | Executed 38 statements in 458µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 93µs | 831ms | Gradescope::Color::color_print |
| 1 | 1 | 1 | 9µs | 9µs | Gradescope::Color::BEGIN@2 |
| 1 | 1 | 1 | 8µs | 439µs | Gradescope::Color::BEGIN@4 |
| 1 | 1 | 1 | 5µs | 15µs | Gradescope::Color::BEGIN@17 |
| 1 | 1 | 1 | 5µs | 13µs | Gradescope::Color::BEGIN@18 |
| 1 | 1 | 1 | 4µs | 13µs | Gradescope::Color::BEGIN@20 |
| 1 | 1 | 1 | 4µs | 9µs | Gradescope::Color::BEGIN@10 |
| 1 | 1 | 1 | 4µs | 21µs | Gradescope::Color::BEGIN@15 |
| 1 | 1 | 1 | 4µs | 5µs | Gradescope::Color::BEGIN@3 |
| 1 | 1 | 1 | 4µs | 24µs | Gradescope::Color::BEGIN@5 |
| 1 | 1 | 1 | 4µs | 11µs | Gradescope::Color::BEGIN@13 |
| 1 | 1 | 1 | 4µs | 59µs | Gradescope::Color::BEGIN@16 |
| 1 | 1 | 1 | 3µs | 6µs | Gradescope::Color::BEGIN@7 |
| 1 | 1 | 1 | 3µs | 33µs | Gradescope::Color::BEGIN@12 |
| 1 | 1 | 1 | 3µs | 9µs | Gradescope::Color::BEGIN@11 |
| 1 | 1 | 1 | 2µs | 2µs | Gradescope::Color::BEGIN@6 |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | 1 | 6µs | package Gradescope::Color v2023.02.14 { | ||
| 2 | 2 | 20µs | 1 | 9µs | # spent 9µs within Gradescope::Color::BEGIN@2 which was called:
# once (9µs+0s) by main::BEGIN@51 at line 2 # spent 9µs making 1 call to Gradescope::Color::BEGIN@2 |
| 3 | 2 | 14µs | 2 | 7µs | # spent 5µs (4+2) within Gradescope::Color::BEGIN@3 which was called:
# once (4µs+2µs) by main::BEGIN@51 at line 3 # spent 5µs making 1 call to Gradescope::Color::BEGIN@3
# spent 2µs making 1 call to utf8::import |
| 4 | 3 | 21µs | 3 | 869µs | # spent 439µs (8+430) within Gradescope::Color::BEGIN@4 which was called:
# once (8µs+430µs) by main::BEGIN@51 at line 4 # spent 439µs making 1 call to Gradescope::Color::BEGIN@4
# spent 421µs making 1 call to strictures::import
# spent 9µs making 1 call to strictures::VERSION |
| 5 | 2 | 21µs | 2 | 44µs | # spent 24µs (4+20) within Gradescope::Color::BEGIN@5 which was called:
# once (4µs+20µs) by main::BEGIN@51 at line 5 # spent 24µs making 1 call to Gradescope::Color::BEGIN@5
# spent 20µs making 1 call to open::import |
| 6 | 1 | 15µs | 1 | 2µs | # spent 2µs within Gradescope::Color::BEGIN@6 which was called:
# once (2µs+0s) by main::BEGIN@51 at line 6 # spent 2µs making 1 call to Gradescope::Color::BEGIN@6 |
| 7 | 2 | 24µs | 2 | 10µs | # spent 6µs (3+3) within Gradescope::Color::BEGIN@7 which was called:
# once (3µs+3µs) by main::BEGIN@51 at line 7 # spent 6µs making 1 call to Gradescope::Color::BEGIN@7
# spent 3µs making 1 call to diagnostics::import |
| 8 | |||||
| 9 | # turn on features | ||||
| 10 | 2 | 21µs | 2 | 14µs | # spent 9µs (4+5) within Gradescope::Color::BEGIN@10 which was called:
# once (4µs+5µs) by main::BEGIN@51 at line 10 # spent 9µs making 1 call to Gradescope::Color::BEGIN@10
# spent 5µs making 1 call to builtin::import |
| 11 | 2 | 16µs | 2 | 15µs | # spent 9µs (3+6) within Gradescope::Color::BEGIN@11 which was called:
# once (3µs+6µs) by main::BEGIN@51 at line 11 # spent 9µs making 1 call to Gradescope::Color::BEGIN@11
# spent 6µs making 1 call to warnings::unimport |
| 12 | 2 | 15µs | 2 | 63µs | # spent 33µs (3+30) within Gradescope::Color::BEGIN@12 which was called:
# once (3µs+30µs) by main::BEGIN@51 at line 12 # spent 33µs making 1 call to Gradescope::Color::BEGIN@12
# spent 30µs making 1 call to feature::import |
| 13 | 2 | 14µs | 2 | 18µs | # spent 11µs (4+7) within Gradescope::Color::BEGIN@13 which was called:
# once (4µs+7µs) by main::BEGIN@51 at line 13 # spent 11µs making 1 call to Gradescope::Color::BEGIN@13
# spent 7µs making 1 call to warnings::unimport |
| 14 | # end prelude | ||||
| 15 | 2 | 13µs | 2 | 38µs | # spent 21µs (4+17) within Gradescope::Color::BEGIN@15 which was called:
# once (4µs+17µs) by main::BEGIN@51 at line 15 # spent 21µs making 1 call to Gradescope::Color::BEGIN@15
# spent 17µs making 1 call to Exporter::import |
| 16 | 2 | 17µs | 2 | 114µs | # spent 59µs (4+55) within Gradescope::Color::BEGIN@16 which was called:
# once (4µs+55µs) by main::BEGIN@51 at line 16 # spent 59µs making 1 call to Gradescope::Color::BEGIN@16
# spent 55µs making 1 call to Carp::Assert::import |
| 17 | 2 | 16µs | 2 | 25µs | # spent 15µs (5+10) within Gradescope::Color::BEGIN@17 which was called:
# once (5µs+10µs) by main::BEGIN@51 at line 17 # spent 15µs making 1 call to Gradescope::Color::BEGIN@17
# spent 10µs making 1 call to Exporter::import |
| 18 | 2 | 19µs | 2 | 21µs | # spent 13µs (5+8) within Gradescope::Color::BEGIN@18 which was called:
# once (5µs+8µs) by main::BEGIN@51 at line 18 # spent 13µs making 1 call to Gradescope::Color::BEGIN@18
# spent 8µs making 1 call to Exporter::import |
| 19 | |||||
| 20 | 2 | 137µs | 2 | 22µs | # spent 13µs (4+9) within Gradescope::Color::BEGIN@20 which was called:
# once (4µs+9µs) by main::BEGIN@51 at line 20 # spent 13µs making 1 call to Gradescope::Color::BEGIN@20
# spent 9µs making 1 call to parent::import |
| 21 | |||||
| 22 | # default exports | ||||
| 23 | 1 | 200ns | our @EXPORT = qw(); | ||
| 24 | # optional exports | ||||
| 25 | 1 | 500ns | our @EXPORT_OK = qw( | ||
| 26 | color_print | ||||
| 27 | ); | ||||
| 28 | |||||
| 29 | 1 | 2µs | 1 | 59.5ms | our $has_colorizer = defined(can_run('bat')); # spent 59.5ms making 1 call to IPC::Cmd::can_run |
| 30 | 1 | 300ns | carp '[suggestion] get `bat` for colorized output' if !$has_colorizer; | ||
| 31 | |||||
| 32 | # spent 831ms (93µs+831) within Gradescope::Color::color_print which was called:
# once (93µs+831ms) by main::RUNTIME at line 97 of /home/hejohns/documentsNoSync/22f/490/gradescope-utils/bin/split.pl | ||||
| 33 | 1 | 28µs | my ($str, $language) = @_; | ||
| 34 | 1 | 38µs | 1 | 831ms | if($has_colorizer && !defined($ENV{GU_NO_PAGER})){ # spent 831ms making 1 call to IPC::Run::run |
| 35 | run ['bat', '-l', $language], '<', \$str; | ||||
| 36 | } | ||||
| 37 | else{ | ||||
| 38 | print $str; | ||||
| 39 | } | ||||
| 40 | } | ||||
| 41 | |||||
| 42 | 1 | 300ns | true; | ||
| 43 | } | ||||
| 44 | |||||
| 45 | # ABSTRACT: Gradescope submission script component | ||||
| 46 | =pod | ||||
| 47 | |||||
| 48 | =encoding utf8 | ||||
| 49 | |||||
| 50 | =head1 DESCRIPTION | ||||
| 51 | |||||
| 52 | =cut |