mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
time: consolidate the different sleep functions into time.wait(Duration) (#8853)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import encoding.base64
|
||||
|
||||
fn test_long_encoding(){
|
||||
fn test_long_encoding() {
|
||||
repeats := 1000
|
||||
input_size := 3000
|
||||
|
||||
@ -13,20 +13,20 @@ fn test_long_encoding(){
|
||||
|
||||
mut s := 0
|
||||
|
||||
ebuffer := malloc( s_encoded.len )
|
||||
for _ in 0..repeats {
|
||||
ebuffer := unsafe { malloc(s_encoded.len) }
|
||||
for _ in 0 .. repeats {
|
||||
resultsize := base64.encode_in_buffer(s_original, ebuffer)
|
||||
s += resultsize
|
||||
assert resultsize == s_encoded.len
|
||||
}
|
||||
|
||||
dbuffer := malloc( s_decoded.len )
|
||||
for _ in 0..repeats {
|
||||
dbuffer := unsafe { malloc(s_decoded.len) }
|
||||
for _ in 0 .. repeats {
|
||||
resultsize := base64.decode_in_buffer(s_encoded, dbuffer)
|
||||
s += resultsize
|
||||
assert resultsize == s_decoded.len
|
||||
}
|
||||
|
||||
println( 'Final s: $s' )
|
||||
println('Final s: $s')
|
||||
// assert s == 39147008
|
||||
}
|
||||
|
Reference in New Issue
Block a user