feat:llgo.Asm
test:asm test with `nop`
This commit is contained in:
18
_demo/asmcall/asmcall.go
Normal file
18
_demo/asmcall/asmcall.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
//llgo:link asm llgo.asm
|
||||
func asm(instruction string) {}
|
||||
|
||||
func main() {
|
||||
start := time.Now()
|
||||
for i := 0; i < 100000; i++ {
|
||||
asm("nop")
|
||||
}
|
||||
duration := time.Since(start)
|
||||
fmt.Println("Duration:", duration)
|
||||
}
|
||||
Reference in New Issue
Block a user