One simplistic approach to measuring the “elapsed time” between events is to just grab the current date and time.
In SQL Server Management Studio
SELECT GETDATE(); SELECT /* query one */ 1 ; SELECT GETDATE(); SELECT /* query two */ 2 ; SELECT GETDATE();
To calculate elapsed times, you could grab those date values into variables, and use the DATEDIFF function:
DECLARE @t1 DATETIME; DECLARE @t2 DATETIME; SET @t1 = GETDATE(); SELECT /* query one */ 1 ; SET @t2 = GETDATE(); SELECT DATEDIFF(millisecond,@t1,@t2) AS elapsed_ms; SET @t1 = GETDATE(); SELECT /* query two */ 2 ; SET @t2 = GETDATE(); SELECT DATEDIFF(millisecond,@t1,@t2) AS elapsed_ms;
That’s just one approach. You can also get elapsed times for queries using SQL Profiler.
Related Posts:
- what does O(N) mean [duplicate]
- Which Python memory profiler is recommended? [closed]
- What is the difference between spark.sql.shuffle.partitions and spark.default.parallelism?
- Java check if boolean is null
- the asymptotic growth of n choose floor(n/2)
- How well does WordPress scale?
- Slow Query for the wp_options table
- What is the best caching option for WordPress multi-site on non-shared hosting?
- WordPress SLOW, tried everything!
- How many posts can I have in a WordPress website?
- WordPress so slow to load on MAMP
- Do multiple revisions really slow down WordPress?
- get_adjacent_post alternative on a very large db
- Fastest server stack configuration for WordPress?
- Cache WordPress translations
- Can we have a post without a slug?
- Refresh external feeds only in cron?
- What is the proper use of https in a modern E-Commerce environment?
- What are best practices for configuring a server for WordPress sites?
- Utilize WordPress Authentication Only
- WordPress tries to load “next page” after done loading current page
- What is a reasonable get_num_queries() result?
- Speeding Up Bulk Post Creation – wp_insert_post & update_post_meta
- How to properly insert a stylesheet in wp_head
- Performance impact of using functions in WordPress?
- Localization / textdomain is slow and chaotic
- WordPress performance issue. Can I debug it?
- Hardcoding and WordPress Performance
- Using Multiple Queries of “home_url” vs. Calling a Variable Multiple Times
- Could a higher number of registered image sizes affect performance?
- What other plugins are there available to track app performance for wordpress?
- Combining multiple javascript and css files
- Why can’t /wp-login.php be load balanced?
- WordPress Meta description – is it better to use manual configuration?
- Preload external PHP information
- Removing translation textdomain
- WordPress site is sloooow, but admin is fast….any ideas?
- AWS (or others) vs VPS
- Do I manually minify css code in my main theme or child theme?
- Is post_class(); going to slow WordPress page speed
- Downsize CPU & DB usage in wordpress
- cross-host benchmarking with wordpress
- Performance problem with first load
- WordPress 3+ slow load times on Ubuntu 10.10
- How to preload images through Code Snippets wp_head for specific pages?
- TTFB increased for no reason
- Can the page load time depend on incidence of visiting?
- Preload Cache for thousands of posts may be on non-production environment
- Page Loading Issue [closed]
- Is it possible to make WordPress PHP faster through caching or compiling it?
- W3 Total Cache: use cache for request with ignorable query string [closed]
- Suggestion to improve slow WordPress page
- Optimizing site speed by localizing paths
- get_the_id, get_the_permalink, and get_the_title all with one DB call
- Optimise page loading time faster on Genesis child theme [closed]
- Long wait times in first part of call to WordPress on Azure
- How to optimize on-the-fly theme switching for mobile browsers?
- Wordress importing scripts
- Server Hardware for WordPress [closed]
- Bandwidth usage increased in WordPress 3.5
- How to test site speed?
- Measure WordPress performance on different hosts
- Performance testing a WordPress site locally?
- wordpress extremely slow on NAS
- Minifing js files with w3 total cache and expiring the combined file [closed]
- Does fixing PHP notices improves website performance?
- How do you make a site load faster when offloading is not an option?
- How do I make content only load on desktop? [duplicate]
- how to embed Pdf and Video Without effecting page speed?
- Slow issues with Website running WordPress on Azure
- WordPress is very slow, even it’s not opening sometimes
- Write/saved logs in WordPress
- Favicon is loading very late
- Website slow : my fault or the host?
- Best way of coding a theme with multiple languages in WordPress
- Website Load Time takes forever
- How fast can I expect WordPress to be on a fresh install locally?
- Change loading order of blocks
- get_template_part calls amount and performance?
- REST api v2 how can modify respond types and make custom DTO for better performance
- Website is loading twice unnecessarily
- What’s the best way to dequeue / remove uncooperative scripts and styles?
- Why is the server response time slowing my site down? [closed]
- High I/O load when hosting lots of wordpress sites
- How to handle high load of traffic of my server
- How to preload the entire site with javascript?
- How we can reduce wordpress page loading time? [closed]
- How to Aggregate, minify and compress (AMC) static and dynamic resources?
- How to improve my site’s loading time?
- How to resolve google page speed issues for wordpress website
- WordPress and TTFB (time to first byte) stats
- What’s a good tool for speed benchmarking? [closed]
- How can we remove “unused”/no long used calls when loading the homepage?
- TTFB is too slow in back-end [closed]
- What kind of data that 3rd part dependencies using?
- Are networks now faster than disks?
- FreeBSD performance tuning: Sysctl parameter, loader.conf, kernel
- High load average, low CPU usage – why?
- Very long initial loading (20sec)
- Identifying Issues in Pagespeed Insights: Server Response Time and Long Main Thread Tasks