difftime

https://github.com/LeiWang1999/FPGA


func TestNameC(t *testing.T) {
c := elliptic.P256()
x, y := c.ScalarBaseMult(big.NewInt(1).Bytes())
for _, v := range []*big.Int{new(big.Int).Set(x), new(big.Int).Set(y)} {
for range []int{1, 2, 3, 4} {
fmt.Print(v.Uint64())
fmt.Print(", ")
v.Rsh(v, 64)
}
fmt.Println()
}
//17627433388654248598, 8575836109218198432, 17923454489921339634, 7716867327612699207,
//14678990851816772085, 3156516839386865358, 10297457778147434006, 5756518291402817435,
s := time.Now()
for i := int64(0); i < 40000; i++ {
c.ScalarMult(x, y, big.NewInt(i).Bytes())
//c.ScalarBaseMult(big.NewInt(i).Bytes())
}
fmt.Println(time.Now().Sub(s))
}


__constant__ _device_ u64 sx[4] = {17627433388654248598ull, 8575836109218198432ull, 17923454489921339634ull, 7716867327612699207ull,},
sy[4] = {14678990851816772085ull, 3156516839386865358ull, 10297457778147434006ull, 5756518291402817435ull,};


time_t st = time(0);
clock_t s = clock();
for (int i = 0; i < 10; i++) {
sleep(2);
}
fprintf(stdout, "%lf s\n", difftime(time(0), st));
fprintf(stdout, "%lu s\n", time(0) - st);
fprintf(stdout, "%lf s\n", (double)(clock() - s)/CLOCKS_PER_SEC);
posted @   zJanly  阅读(3)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
点击右上角即可分享
微信分享提示