time.c revision 1.9
190075Sobrien/* Copyright (C) 2006-2018 Free Software Foundation, Inc. 290075Sobrien Contributed by Francois-Xavier Coudert <coudert@clipper.ens.fr> 3132718Skan 490075Sobrien This file is part of the GNU Offloading and Multi Processing Library 590075Sobrien (libgomp). 690075Sobrien 790075Sobrien Libgomp is free software; you can redistribute it and/or modify it 8132718Skan under the terms of the GNU General Public License as published by 990075Sobrien the Free Software Foundation; either version 3, or (at your option) 1090075Sobrien any later version. 1190075Sobrien 1290075Sobrien Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY 1390075Sobrien WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 1490075Sobrien FOR A PARTICULAR PURPOSE. See the GNU General Public License for 1590075Sobrien more details. 16132718Skan 1790075Sobrien Under Section 7 of GPL version 3, you are granted additional 1890075Sobrien permissions described in the GCC Runtime Library Exception, version 1990075Sobrien 3.1, as published by the Free Software Foundation. 2090075Sobrien 21132718Skan You should have received a copy of the GNU General Public License and 2290075Sobrien a copy of the GCC Runtime Library Exception along with this program; 2390075Sobrien see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 24169689Skan <http://www.gnu.org/licenses/>. */ 25169689Skan 26132718Skan/* This file contains timer routines for mingw32. */ 2790075Sobrien 2890075Sobrien#include "libgomp.h" 2990075Sobrien#include <unistd.h> 3090075Sobrien#include <sys/timeb.h> 3190075Sobrien 32132718Skandouble 3390075Sobrienomp_get_wtime (void) 3490075Sobrien{ 3590075Sobrien struct _timeb timebuf; 3690075Sobrien _ftime (&timebuf); 3790075Sobrien return (timebuf.time + (long)(timebuf.millitm) / 1e3); 3890075Sobrien} 3990075Sobrien 4090075Sobriendouble 4190075Sobrienomp_get_wtick (void) 4290075Sobrien{ 4390075Sobrien return 1e-3; 4490075Sobrien} 4590075Sobrien 4690075Sobrienialias (omp_get_wtime) 47132718Skanialias (omp_get_wtick) 4890075Sobrien