time

Trouble measuring the elapsed time of a CUDA program and CUDA kernels

ε祈祈猫儿з 提交于 2020-01-23 04:11:09
问题 I currently have three methos of measuring the elapsed time, two using CUDA events and the other recording start and end UNIX. The ones using CUDA events measure two things, one measures the entire outer loop time, and the other sum all kernel execution times. Here's the code: int64 x1, x2; cudaEvent_t start; cudaEvent_t end; cudaEvent_t s1, s2; float timeValue; #define timer_s cudaEventRecord(start, 0); #define timer_e cudaEventRecord(end, 0); cudaEventSynchronize(end); cudaEventElapsedTime(

Convert an NSDate to a Unix timestamp using a particular time zone

前提是你 提交于 2020-01-23 01:43:13
问题 I am trying to get the Unix timestamp using a particular time zone (not necessarily the same time zone as the system) I tried this : NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; NSTimeZone *gmt = [NSTimeZone timeZoneWithName:@"Australia/Melbourne"]; [dateFormatter setTimeZone:gmt]; NSString *timeStamp = [dateFormatter stringFromDate:[NSDate date]]; NSDate *curdate = [dateFormatter dateFromString:timeStamp]

Capturing reaction times using Javascript, accuracy concerns

烂漫一生 提交于 2020-01-22 15:04:08
问题 I'm building a dot probe task (people have to react quickly to a dot after an image disappears) and we need to measure reaction times and show stimuli for pre-defined intervals for usage in an online therapy study. We already decided on Javascript and we're willing to impose some constraints on users, i.e. ruling out IE etc. We can't ban Windows completely though. I read John Resig's post on the topic and according to this we'll have to ban every browser on Windows except Firefox and Chrome.

How to convert float into Hours Minutes Seconds?

拟墨画扇 提交于 2020-01-22 03:33:09
问题 I've values in float and I am trying to convert them into Hours:Min:Seconds but I've failed. I've followed the following post: Converting a float to hh:mm format For example I've got a value in float format: time=0.6 result = '{0:02.0f}:{1:02.0f}'.format(*divmod(time * 60, 60)) and it gives me the output: 00:36 But actually it should be like "00:00:36". How do I get this? 回答1: Divmod function accepts only two parameter hence you get either of the two Divmod() So you can try doing this: time =

NTP Client using the Windows API

淺唱寂寞╮ 提交于 2020-01-22 02:22:09
问题 I'm maintaining a legacy system (pre .NET). Is there any way to fetch the time from an NTP server using the Windows API? Failing that, I could probably create a COM object with .NET to do it, but I would rather not go to that effort. 回答1: Yes, it's certainly possible. Unless you're quite ambitious, it's probably easiest to start from working source code. I'd go for Terje Mathisen's port, but that's probably because I've known Terje via Usenet (comp.lang.asm.x86) for years -- the other ports

Select “Time Description” based on current date and time in Google Sheets (VLookup, Query)

。_饼干妹妹 提交于 2020-01-22 02:10:25
问题 The bounty expires in 2 days . Answers to this question are eligible for a +100 reputation bounty. Gracie wants to draw more attention to this question: “Current answers do not fully work or contain hard-coded descriptions in the function. The descriptions may change so the cells need to be referenced.” I am trying to use VLookup or QUERY to extract a day and time description based on the current date and time. I thought QUERY may be the best here, but VLOOKUP seems to be the best solution

Select “Time Description” based on current date and time in Google Sheets (VLookup, Query)

时光毁灭记忆、已成空白 提交于 2020-01-22 02:09:32
问题 The bounty expires in 2 days . Answers to this question are eligible for a +100 reputation bounty. Gracie wants to draw more attention to this question: “Current answers do not fully work or contain hard-coded descriptions in the function. The descriptions may change so the cells need to be referenced.” I am trying to use VLookup or QUERY to extract a day and time description based on the current date and time. I thought QUERY may be the best here, but VLOOKUP seems to be the best solution

mktime and tm_isdst

◇◆丶佛笑我妖孽 提交于 2020-01-21 01:15:07
问题 I saw a lot of different views so thought of asking here. I read man mktime : (A positive or zero value for tm_isdst causes mktime() to presume initially that summer time (for example, Daylight Saving Time) is or is not in effect for the specified time, respectively. A negative value for tm_isdst causes the mktime() function to attempt to divine whether summer time is in effect for the specified time. My question is, shouldn't tm_isdst be kept as -1 to let the system decide if its dst or not

R issue with rounding milliseconds

谁都会走 提交于 2020-01-20 05:00:19
问题 Given the following issue with rounding milliseconds under R. How do I get around it so that the times are correct? > options(digits.secs=3) > as.POSIXlt("13:29:56.061", format='%H:%M:%OS', tz='UTC') [1] "2012-06-07 13:29:56.060 UTC" > as.POSIXlt("13:29:56.062", format='%H:%M:%OS', tz='UTC') [1] "2012-06-07 13:29:56.061 UTC" > as.POSIXlt("13:29:56.063", format='%H:%M:%OS', tz='UTC') [1] "2012-06-07 13:29:56.063 UTC" I noticed that this URL provides background information but doesn't solve my

Convert time.Time to string

我与影子孤独终老i 提交于 2020-01-19 04:46:05
问题 I'm trying to add some values from my database to a []string in Go. Some of these are timestamps. I get the error: cannot use U.Created_date (type time.Time) as type string in array element Can I convert time.Time to string ? type UsersSession struct { Userid int Timestamp time.Time Created_date time.Time } type Users struct { Name string Email string Country string Created_date time.Time Id int Hash string IP string } - var usersArray = [][]string{} rows, err := db.Query("SELECT u.id, u.hash