#include <stdio.h>
#include <sys/time.h>
#include <string.h> union data
{
unsigned char str[];
unsigned long long ll_value[];
unsigned int i_value[];
}; int main(int argc, char **argv)
{
union data a;
union data b;
struct timeval start, end;
int i = ; memset((char *)&a, , );
memset((char *)&b, , ); gettimeofday(&start, NULL);
for (i = ; i < ; i++)
{
a.str[i] = a.str[i] ^ b.str[i];
}
gettimeofday(&end, NULL);
printf("take %dus \n", (int)(((end.tv_sec-start.tv_sec)*+end.tv_usec)-start.tv_usec)); gettimeofday(&start, NULL);
for (i = ; i < ; i++)
{
a.ll_value[i] = a.ll_value[i] ^ b.ll_value[i];
}
gettimeofday(&end, NULL);
printf("take %dus \n", (int)(((end.tv_sec-start.tv_sec)*+end.tv_usec)-start.tv_usec)); gettimeofday(&start, NULL);
for (i = ; i < ; i++)
{
a.i_value[i] = a.i_value[i] ^ b.i_value[i];
}
gettimeofday(&end, NULL);
printf("take %dus \n", (int)(((end.tv_sec-start.tv_sec)*+end.tv_usec)-start.tv_usec));   return 0;
}

take 21us
take 3us
take 5us

最新文章

  1. Working with Data &#187; Getting started with ASP.NET Core and Entity Framework Core using Visual Studio &#187; 读取关系数据
  2. Asp.Net Web API 2第十一课——在Web API中使用Dependency Resolver
  3. 《Programming with Objective-C》
  4. hdu Largest Rectangle in a Histogram
  5. SDP学习笔记
  6. [itint5]任务调度
  7. EasyUI + Spring MVC + hibernate实现增删改查导入导出
  8. 『重构--改善既有代码的设计』读书笔记----Introduce Explaning Variable
  9. DB2 runstats和reorg操作
  10. Jmeter正则提取器常用的几种方式
  11. 打印pid,写着玩。
  12. 【JAVA】pdf转图片
  13. idea,mybatis读取配置文件报错:Could not find resource configuration.xml
  14. DP题组
  15. Mac下nodeJS初体验
  16. tensoFlow之DNN文本分类
  17. Styles in Windows Phone
  18. H5+App开发框架汇总
  19. DataContract和DataMember的作用
  20. 洛谷 P1135 奇怪的电梯

热门文章

  1. cocos2d-x动作原理
  2. iOS银行卡合法性校验
  3. JMX笔记(一)
  4. PHP--关于模板的原理和解析
  5. CF Fox And Two Dots (DFS)
  6. Oracle 版本查看及版本号说明
  7. Windows 8.1 归档 —— Step 3 软件的选择与安装
  8. Java Concurrency - 线程执行器
  9. HDOJ2013蟠桃记
  10. Entity Framework 6.1-Database First介绍