time.c 417 B

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2010-11-17 Bernard first version
  9. */
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. int speed()
  13. {
  14. int i;
  15. time_t t;
  16. printf("%d\n", time(0));
  17. for (i = 0; i < 10000000; ++i)
  18. t = time(0);
  19. printf("%d\n", time(0));
  20. return 0;
  21. }