1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 06:37:46 +00:00

rename date format to format date (#571)

This commit is contained in:
Antoine Stevan 2023-08-04 16:08:10 +02:00 committed by GitHub
parent 1d8457fa9d
commit be47e43db6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 37 additions and 37 deletions

View file

@ -9,7 +9,7 @@ let is_release = "y"
if ($is_release | str downcase | str trim) == "y" {
print $"running test 0 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')"
print $"running test 0 at (date now | format date '%Y-%m-%d %H:%M:%S.%3f')"
# 0. this has wrong output
let 0 = (seq 10 | timeit {
let height = 40
@ -29,7 +29,7 @@ if ($is_release | str downcase | str trim) == "y" {
} | math avg)
print $"running test 1 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')"
print $"running test 1 at (date now | format date '%Y-%m-%d %H:%M:%S.%3f')"
# 1. Fixed newline to fix the output (char cr)
let 1 = (seq 10 | timeit {
let height = 40
@ -48,7 +48,7 @@ if ($is_release | str downcase | str trim) == "y" {
} | str join
} | math avg)
print $"running test 2 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')"
print $"running test 2 at (date now | format date '%Y-%m-%d %H:%M:%S.%3f')"
# 2. Replace (char sp) with just space
let 2 = (seq 10 | timeit {
let height = 40
@ -67,7 +67,7 @@ if ($is_release | str downcase | str trim) == "y" {
} | str join
} | math avg)
print $"running test 3 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')"
print $"running test 3 at (date now | format date '%Y-%m-%d %H:%M:%S.%3f')"
# 3. Precompute (ansi -e '48;2;0;0;') and (ansi -e '0m') -- seems to be slower
let 3 = (seq 10 | timeit {
let height = 40
@ -88,7 +88,7 @@ if ($is_release | str downcase | str trim) == "y" {
} | str join
} | math avg)
print $"running test 4 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')"
print $"running test 4 at (date now | format date '%Y-%m-%d %H:%M:%S.%3f')"
# 4. Inline iter_inc call
let 4 = (seq 10 | timeit {
let height = 40
@ -107,7 +107,7 @@ if ($is_release | str downcase | str trim) == "y" {
} | str join
} | math avg)
print $"running test 5 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')"
print $"running test 5 at (date now | format date '%Y-%m-%d %H:%M:%S.%3f')"
# 5. Combine (char sp) substitution and iter_inc inlining
let 5 = (seq 10 | timeit {
let height = 40
@ -126,7 +126,7 @@ if ($is_release | str downcase | str trim) == "y" {
} | str join
} | math avg)
print $"running test 6 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')"
print $"running test 6 at (date now | format date '%Y-%m-%d %H:%M:%S.%3f')"
# 6. The above with par-each outer loop (using par-each anywhere else breaks the output)
let 6 = (seq 10 | timeit {
let height = 40